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 » Ambiguity while inserting/Update data using stored proc.

Post new topic  Reply to topic
 Ambiguity while inserting/Update data using stored proc. « View previous topic :: View next topic » 
Author Message
Shwetabh
PostPosted: Tue Sep 29, 2015 2:58 am    Post subject: Ambiguity while inserting/Update data using stored proc. Reply with quote

Newbie

Joined: 03 Aug 2015
Posts: 8

Hi Team,
We are having a situation:-
MQInput(transactional property set to Yes) -> Compute node(Making stored proc call twice and create xml output) -> MQOutput.

Compute mode is set to Automatic.

We are making stored proc 'A' call twice in such a way ,first call will insert in table T and in later part of same esql ,we update table T using same stored proc A.we are not using any commit operation in between to maintan transactionality.However one of the column is not updated correctly in table once transaction is complete.

But in the final xml generated , we are able to see the correct value in the xml tag.
Value is populated from input message.


What can be the possible reason?
Will there be two ODBC connection in this case.Probably not.My main dilemma is whether the sequence is maintained while executing the two insert/update on saame table using stored proc?

Please guide.

Regards,
SSS
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 01, 2015 6:18 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There's only one ODBC connection available for each instance of the message flow that's running.

You can't do an insert and an update in the same transaction, as the insert is not committed until the transaction is, and so the update can't execute.

This doesn't have anything to do with how your message tree is populated.

You may have luck moving the update logic to a second compute node.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Shwetabh
PostPosted: Thu Oct 01, 2015 6:40 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2015
Posts: 8

Hi Jeff,
I agree there will be commit after transaction is complete and there is one ODBCconnection if we are connecting to one db. But we can give two insert ,insert and update in one compute node without any commit command in between.DML is managed by resource manager which will execute the sequence in the order it gets request.
Let's have analogy.in SQL developer we give two different insert statement and then commit.It is the work of resource manager to schedule the job.

However I made it non transactional by giving commit between first insert and second update .After first insert ,it is populating data properly.However after second commit it is not .

Either it is transactional or non transactional,it is giving same value.
Plus
In one of my local system ,it is working fine.
In other two it is not.

I had doubt on dsn configured on different system but config looks similar in all system .There are other fields with similar value and are getting populated properly.


Please correct me if I am wrong.
Back to top
View user's profile Send private message
Shwetabh
PostPosted: Thu Oct 01, 2015 6:51 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2015
Posts: 8

Plus it is not parallel operation as in case of any etl where different nodes try to execute parallel at same time.RM knows the timestamp when particular request is receiced.we are running one transaction only.So not an issue with multiple instance running parallel
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 01, 2015 7:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Yes. I agree. It's not an issue with multiple instances running parallel. They would each have their own connection and each have their own transaction.

You need to do something to either do the insert out of transaction or otherwise make sure it has been committed before you try and update the same record.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Shwetabh
PostPosted: Thu Oct 01, 2015 7:11 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2015
Posts: 8

Like I said before ,I tried that also by inserting commit after first insert.same result at end.
However after first commit data getting inserted is correct.But second update is giving ambiguous result.

Plus

Code is giving proper result when I am running on IIB 9001 but not properly on iIB 9003 a and wmb7.

However I don't think this is issue with version as these are simple operations .

I suspected drivers and dsn properties on different system too.However that issue will not be there too as on system where one column is not getting updated properly.other column is updated properly.

need to enable log at db end and see why stored process behaving so.What value it is getting in input.

However please update me if same issue replicate and able to resolve.

With regards,
SSS
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 » Ambiguity while inserting/Update data using stored proc.
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.