|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Transaction will be committed, but a pending automatic trans |
« View previous topic :: View next topic » |
Author |
Message
|
gin123 |
Posted: Wed Apr 16, 2014 9:36 pm Post subject: Transaction will be committed, but a pending automatic trans |
|
|
Newbie
Joined: 16 Apr 2014 Posts: 4
|
I'm facing a similar issue as the problem in this post (the forum says, 'You must have 1 posts before you can post URL's/Links.', so I can't post the link. Search for the topic with the same subject as mine), but it's solution hasn't worked for me.
I'm using MB 7.0.0.3
My flow initiates with FileInput node where the transaction mode is set to 'No'. There are a couple compute nodes in my main flow that successfully write and query the db. It calls a subflow, which propagates to an output node that points back to the main flow which is supposed to do another db write. However, when that node is entered (before it even gets to the db write statement), it throws an exception: "Transaction will be committed, but a pending automatic transaction exists" from ImbDatabaseInteractionNode::checkForActiveTransaction. All of the compute nodes that interact with the DB use the same DSN, and have the transaction set to commit.
Checking the database while stepping through the code with the debugger, I have verified that all previous database writes and updates have completed. Querying Oracle's v$transaction table does not show any pending transactions.
Is there a way for me to query MB to find out what pending transactions it views as having?
Any help would be greatly appreciated |
|
Back to top |
|
 |
Esa |
Posted: Wed Apr 16, 2014 11:26 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
You don't need to query the database for pending transactions. The pending transaction is the transaction that is opened by the previous node in the same flow instance. The problem is in your design.
When a node that accesses a database is executed, it doesn't commit the transaction immediately. The transaction is committed the the whole flow has executed, immediately before the MQ transaction is committed (if there is any).
So if you flow has several nodes that access the same database, that is probaly what you will get. I guess it is not a database exception but a warning. It is warning you that the changes you made in the previous node may not be visible in the current node because the transaction hasn't been committed yet.
I guess your node has 'treat warnings as errors' setting on?
In my opinion, the safest solution would be to access the database from one single node only. Replace the subflow with a call to an ESQL procedure.
Disclaimer: this may be one of my misleading guesses again. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 17, 2014 5:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Or just change the commit mode on the relevant compute nodes... |
|
Back to top |
|
 |
gin123 |
Posted: Thu Apr 17, 2014 2:52 pm Post subject: Making sense to me now... |
|
|
Newbie
Joined: 16 Apr 2014 Posts: 4
|
Thanks for your replies!
I think that I'm making sense of what is going on now.
From what Esa mentioned and I now see in my debugger, is that after node x calls a propagate statement to go to node y, when node y terminates it returns to node x. When the transaction is set to commit, the transaction does not end until the node is exited. That is why when node x and node y use the same DSN, they are being used within the same transaction.
My short term solution has been to use a different DSN by node y, which has worked. I'm going to re-examine my design as suggested and see if I can make things simpler now that I know how the transaction is being handled.
p.s. the 'Treat warnings as errors' was off, but the 'Throw exception on database error' was on
javascript:emoticon(' ') |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|