ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » BIP4002E: Transaction state is not consistent

Post new topic  Reply to topic
 BIP4002E: Transaction state is not consistent « View previous topic :: View next topic » 
Author Message
Cogito-Ergo-Sum
PostPosted: Sun Jan 30, 2011 11:49 pm    Post subject: BIP4002E: Transaction state is not consistent Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

I have seen the description of this message in the documentation. But, I do not follow it. Let me give some description.

I have a MQInput node that holds messages having TranID. The requirement is such that, this TranID should not be existing already in a given table (T1). If it does, then this TranID must be logged in T1 with status flag as say 'F' (for failed). In addition to this, the message flow must throw an exception to indicate that an invalid TranID was received. If the TranID is not found, then T1 is inserted with TranID with status flag as say 'P' (for processing). Much later in the flow, the status flag would be changed back to 'C' (for complete).

To do this, I am having a Database node (D1) that checks if TranID exists in T1 already. If yes, then with ESQL PROPAGATE, I am passing control to Out1 that is connected to a DatabaseInsert node (DI1) where a table row is inserted. This row will have status flag as 'F'. The Out terminal of DI1 is connected to a Throw terminal to raise the exception. If D1 does not find the row, then with ESQL PROPAGATE, I am passing control to Out2 that is connected to DatabaseInsert node (DI2) where a table row is inserted. This row will have status flag as 'P'.

When the flow goes along Out1 terminal of D1, then table does not have the row with status flag as 'F'. This is probably because the Throw node throws an exception that causes the insert to be rolled back. This is when all the database nodes (D1, DI01 and DI02) are with 'Transaction' property set to 'Automatic'. To persist the database changes, I changed the property value to 'Commit' (as described here). At this point, I get this error message:
Code:
BIP4002E: Transaction state is not consistent with the value of 'transaction' attribute in node WBRKBKDB.


    1. There is no node with name as WBRKBKDB; although, this is the DataSource I am using with all the database nodes (D1, DI01 and DI02). So, why does this name appear ?
    2. Isn't the 'Commit' value of 'Transaction' property supposed to commit the changes immediately - that is, once the node is over regardless whether an exception is thrown later ?
    3. If yes (to 2) above, then what made the transaction state inconsistent (ref BIP4002) ?
    4. I probably have to go the way of 'Uncoordinated auxiliary transactions'. If so, can this be done on z/OS also ?
    5. I am currently following the 'Error Handler' sample and see if sub-flows will help. But, my main questions are 1 to 3 above.


Kindly advise me where can I learn more about resolving this issue.
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
fatherjack
PostPosted: Mon Jan 31, 2011 2:37 am    Post subject: Reply with quote

Knight

Joined: 14 Apr 2010
Posts: 522
Location: Craggy Island

Dunno why the error has the DSN as the node. Maybe a bug.

But re. the exception the doc says

Code:
However, an active transaction already exists on that database, which would be committed prematurely if this node did a commit. This situation can arise if a previous node which caused a database update on the same DSN had the transaction property of 'automatic' specified. The message flow logic is regarded as inconsistent in such a situation.


So have you got any database updates in an earlier node in your flow?
_________________
Never let the facts get in the way of a good theory.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Mon Jan 31, 2011 3:47 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

Quote:
So have you got any database updates in an earlier node in your flow?

No. After the MQInput node, the D1 is just a SELECT statement.
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Mon Jan 31, 2011 3:58 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

I have been trying with the 'Error Handler' sample and not having much luck there too. Actually the sample is 'opposite' of my requirement. Upon an exception, the sample rolls back an update; whereas, I have to persist the update.

I used a TryCatch node. In the Try flow, I have D1 which throws the exception if the TranID was found. I have connected the Catch terminal to a sub-flow where a DataInsert does an insert to T1. In this case, while the database insert persists, the syslog does not report the exception !
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Mon Jan 31, 2011 4:07 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

BTW, the inconsistency message does not appear any more because I have used a different ODBC entry pointing to the same database.

Database access modes and locks
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » BIP4002E: Transaction state is not consistent
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.