Second Application Deployed With its Own "TransactionFactory" Uses the Transaction of the First Application (Doc ID 577521.1)

Last updated on JUNE 30, 2017

Applies to:

Oracle JDeveloper - Version 10.1.3.3.0 and later
Information in this document applies to any platform.

Symptoms


You want to use a custom DBTransactionFactory.
You followed the article "Creating and Using a Custom DBTransaction Implementation" from Steve Muench.
You set the value of the ADF configuration property named TransactionFactory to the fully-qualified class name of your custom DatabaseTransactionFactory class.

It works fine and your application correctly uses your custom DBTransactionFactory.
However, if you deploy another application in the same Web Container and also using its own custom DBTransactionFactory, you notice that the second application uses the same DBTransactionFactory as the first application.

Suppose f.ex. that Application1 has TransactionFactory=<package>.CustomDatabaseTransactionFactory1 and Application2 has TransactionFactory=<package>.CustomDatabaseTransactionFactory2.
If you add the following code in your Class CustomDatabaseTransactionFactory1 to output the object created (Class + instance ID):

public class CustomDatabaseTransactionFactory1 extends  DatabaseTransactionFactory {

public DBTransactionImpl2 create() {
   System.out.println("CustomDatabaseTransactionFactory1.create() " + this);
   return new CustomDBTransactionImpl1();
}

you see that both applications use the same instance of the same class of CustomDatabaseTransactionFactory1.
When running Application2, you see the following output:

08/05/16 08:22:36 CustomDatabaseTransactionFactory1.create()
<yourPackage>.CustomDatabaseTransactionFactory1@1a5fdb9



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms