|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
About DB2 tables and LOCK |
« View previous topic :: View next topic » |
Author |
Message
|
Testo |
Posted: Mon Jul 26, 2004 1:36 am Post subject: About DB2 tables and LOCK |
|
|
 Centurion
Joined: 26 Feb 2003 Posts: 120 Location: Italy - Milan
|
Two questions:
1. Is it possible to LOCK a DB2 table in a OS390 env from a message flow? If yes, what happens if the flow then gets an exception? Should I manage the UNLOCK from the catch path of the flow? I have this need because I'm trying to move some logic from a DB2 stored procedure to a WMQI 2.1 message flow; the DB2 SP contains this LOCK instruction and I'm wondering if I can use it in the flow as well...
2. What happens to a flow that is trying to perform a SEL/INS/UPD from a table that is currently locked? Does it get an exception immediately or does it wait for a timeout?
Thanks in advance for any hint,
Cheers,
Andrea Tedone
IBM IT Specialist |
|
Back to top |
|
 |
alexey |
Posted: Mon Jul 26, 2004 4:33 am Post subject: |
|
|
 Acolyte
Joined: 18 Dec 2003 Posts: 62 Location: Israel
|
Hi.
I did not try this on DB2 OS390, but I have tried it with SQL Server on W2K. If your flow is transactional (trans=YES on the MQInput) and the commit mode is automatic, the flow locks the table during the processing. After the flow ends, the tranaction released on the DB also. I've tested the opposite way too, and when the table is locked on the SQL Server, the flow waits to the lock to be relesed and than continues. I think there's some timeout on this wait, but I'm not sure if it can be configured.
Hope this helps.
Alexey. |
|
Back to top |
|
 |
kirani |
Posted: Tue Jul 27, 2004 4:59 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
I believe you can specify the timeout value on the DB side. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Testo |
Posted: Mon Sep 27, 2004 1:19 am Post subject: Some other considerations.... |
|
|
 Centurion
Joined: 26 Feb 2003 Posts: 120 Location: Italy - Milan
|
I will continue with this thread as my current issue is always related to DB2 and locks.
I have a transactional message flow where I would like to get a lock on a specific table and for a specific record since the beginning of the flow, even if the update of that record will occur later in the flow (i.e. some milliseconds after) and not for sure - the update is under some conditions.
To obtain this result, a DB expert told me that I could perform, in the very first compute node, a 'SELECT * FROM <table> WHERE <conditions> FOR UPDATE OF <columnname>; in this manner, the record should be locked until the commit.
My question is: what happens if I don't execute the update on that column? Is the end of the flow considered as a commit? And what happens if I do execute the update but on other columns or in that columns together with other ones?
Thanks in advance for any suggestion,
Cheers
Andrea Tedone
IBM IT Specialist |
|
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
|
|
|
|