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 » Db Transaction Commit

Post new topic  Reply to topic
 Db Transaction Commit « View previous topic :: View next topic » 
Author Message
Maverik
PostPosted: Wed Jul 12, 2006 11:40 pm    Post subject: Db Transaction Commit Reply with quote

Apprentice

Joined: 14 Jun 2005
Posts: 27

Hello all,

I have a flow with two compute nodes accessing the same database.

The first compute only does a select on a table. The second compute is doing a insert into the same table later in the flow.

I am getting a Transaction will be committed later, as there is a pending automatic transaction existing error. I tried changing the insert compute nodes transaction to Commit, then i made both commit, but nothing is working.

I searched the forum and found the solution of declaring a new dsn, but dont want to do that.

Please help.
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Thu Jul 13, 2006 1:16 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

What DB are you using ?
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Maverik
PostPosted: Thu Jul 13, 2006 1:53 am    Post subject: Reply with quote

Apprentice

Joined: 14 Jun 2005
Posts: 27

Using DB2 8.2 and WBIMB v 6.0.0.1

Thanks.
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Thu Jul 13, 2006 1:56 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

After changing the transaction mode to Commit what errors, if any, are you getting ?
I have used a similar scenario as yours with V2.1 and I did not face any problems.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Maverik
PostPosted: Thu Jul 13, 2006 2:08 am    Post subject: Reply with quote

Apprentice

Joined: 14 Jun 2005
Posts: 27

Let me explain about my flow

MQInput(Tx:Automatic)-->compute1(Tx: Automatic, select from table)-->tryCatch

try of TryCatch-->compute2(Tx: Automatic, doing some validation, no db interaction, multiple propagates)-->MQOutput(Tx:No)

catch of TryCatch-->compute3(Tx: Commit, insert to same table)-->MQOutput(Tx:No)

The error from the failure terminal of the compute3 is "Transaction will be committed, but a pending automatic transaction exists".

Which is this automatic transaction is what i cant figure out ?

Thanks in advance
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Thu Jul 13, 2006 3:07 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

Let me simulate this scenario and see what happens:
Meanwhile ponder on this:
If there is no error the flow path will not travel through the catch.
Now in normal scenario the flow is :
MQInput->Compute->TryCatch->Compute2->MQOutput

In all the nodes except the last(MQOutput) the transaction mode is automatic.
Now in the last you are changing the mode to explicit ->commit.
Hence the error, I think.
If you change the transaction mode to Automatic in the MQOutput, the error should go away.
I am still working on this in simulation.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
shalabh1976
PostPosted: Thu Jul 13, 2006 3:54 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

I checked and found that what you say happens.
If I change the transaction mode to commit on the first compute then the problem is resolved.
Since I am anyway doing a SELECT there this should not make any difference.
I opened one of my earlier flows to see this and indeed that is how I had done it also.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Maverik
PostPosted: Thu Jul 13, 2006 4:33 am    Post subject: Reply with quote

Apprentice

Joined: 14 Jun 2005
Posts: 27

Thanks shalabh1976 !!

That worked.

My only doubt now is, what if tomorrow i have an insert first and then another insert, and i don't want the first to be committed but the second to be, then what will I do, Or will i have to make my design to simply avoid these situations.
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Thu Jul 13, 2006 4:58 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

This is a simple database concept:
A rollback will rollback all transactions till the last commit point.
A commit will commit all transactions till the last commit.
You can never have a scenario where you do
Trans A followed by Trans B
You want Trans A to be under syncpoint control but not Trans B !!!
The moment Trans B is commited Trans A has to be committed.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jbanoop
PostPosted: Sat Jul 15, 2006 10:30 pm    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

U could try using two datasources (DSNs) pointing to the same DB. Use one DSN for all the nodes you want to commit the transaction(s) on and the toher one for the automatic ones. It should work fine.
Regards,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
amol5985
PostPosted: Mon Jun 18, 2012 4:26 am    Post subject: Reply with quote

Newbie

Joined: 29 Sep 2010
Posts: 5

Hi shalabh1976,

I am getting the same exception but in my case for both the compute node has same transaction property as "Commit".

In my scenario compute1 is in main flow and compute2 is in subflow. Message is getting propagated to the failure terminal from compute1 and failure terminal is connected to the subflow which do the database insert for exception table.

Now this problem is getting resolved in case if I select a Transaction property as "Automatic" for compute2.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Db Transaction Commit
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.