Hi, I’m having trouble with nested transactions. In my example all the adapters use the same JDBC connection, which is one of type “Local Transaction”. I have 2 Flow Services:
Flow Master
Flow Nested
Flow Master FONT=Times New Roman[/font] (Success Sequence) (Failure Sequence) Adapter Call – Simple Insert (using LocalTransaction A) Call to another Flow Service (Flow Nested) (Commit Transaction) (Done Sequence) GetLastError (RollBack Transaction) Exit Flow Signaling Failure Flow Nested FONT=Times New Roman[/font] (Success Sequence) (Failure Sequence) Adapter Call – Another Simple Insert (using LocalTransaction A) (Commit Transaction) (Done Sequence) GetLastError (RollBack Transaction) Exit Flow Signaling Failure Error: 2009-08-11 08:22:47 AST [ART.0114.1007E] Adapter Runtime: Error Logged. See Error log for details. Error: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service Pruebas:adpNested. [ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource mpIntCommonTW.conexiones:interwm. The resource is already being used in a parent transaction. I’m using:
Hi,
Here the problem is the transaction is open in the parent service which is not closed before opening the another transaction in the Flow Nested .
To resolve this you can change the logic as below
by handeling the transaction only in Flow Master;
Flow Master
FONT=Times New Roman[/font] (Success Sequence) (Failure Sequence) Adapter Call – Simple Insert (using LocalTransaction A) Call to another Flow Service (Flow Nested) (Commit Transaction) (Done Sequence) GetLastError (RollBack Transaction) Exit Flow Signaling Failure
I was looking at the documentation “6-5_JDBC_Adapter_Users_Guide.pdf” and in the transaction section it specified the following:
A new explicit transaction context can be started within a transaction context, provided that you ensure that the transactions within the transaction context are completed in the reverse order they were started—that is, the last transaction to start should be the first transaction to complete, and so forth.
For example, consider the following is a valid construct:
It seems that nested transactions as the documentation explains are allowed. The only catch is that: Nested transaction can be done, only if, the nested transactions do not have any service adapters that use the same connection that a parent transaction already use. If the adapter of the nested transaction uses the same connection the following error will appear. 2009-08-11 08:22:47 AST [ART.0114.1007E] Adapter Runtime: Error Logged. See Error log for details. Error: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service Pruebas:adpNested. [ART.117.4011] Adapter Runtime (Adapter Service): Unable to connect to resource mpIntCommonTW.conexiones:interwm. The resource is already being used in a parent transaction.