473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Urgent - need help

I have a situation where one of the app server thread is executing an
update statement on A record and at the same time another thread is
trying to read it by executing a select query. Now we are seeing
timeouts - Update query is holding the lock and the select statement
is timing off.

Now my question , how can I design this select statement so that it
doesn't wait for this update to be commiitted - I do not want to run
it with UR since it will allow dirty reads -
The lock is acquired via the following statement: UPDATE SIALRFCDATA
SET BLOBDATA=?, CREATED_DATE=?, FIELD1=? WHERE ORDERS_ID=? AND
TRANSACTION_TYPE=? AND RECORD_TYPE=?

The select query

SELECT ORDERS_ID, TRANSACTION_TYPE, RECORD_TYPE, CREATED_DATE,
MARKFORDELETE, CDATA, BLOBDATA, FIELD1, FIELD2, FIELD3, FIELD4 FROM
SIALRFCDATA WHERE ORDERS_ID = ? AND TRANSACTION_TYPE = ? AND
RECORD_TYPE =

Thanks

Rajib
Jun 27 '08 #1
1 1519
On Jun 28, 1:31*am, contactra...@yahoo.com wrote:
I have a situation where one of the app server thread is executing an
update statement on A record and at the same time another thread is
trying to read it by executing a select query. Now we are seeing
timeouts - Update query is holding the lock and the select statement
is timing off.

Now my question , how can I design this select statement so that it
doesn't wait for this update to be commiitted - I do not want to run
it with UR since it will allow dirty reads -

The lock is acquired via the following statement: UPDATE SIALRFCDATA
SET BLOBDATA=?, CREATED_DATE=?, FIELD1=? WHERE ORDERS_ID=? AND
TRANSACTION_TYPE=? AND RECORD_TYPE=?

The select query

SELECT ORDERS_ID, TRANSACTION_TYPE, RECORD_TYPE, CREATED_DATE,
MARKFORDELETE, CDATA, BLOBDATA, FIELD1, FIELD2, FIELD3, FIELD4 FROM
SIALRFCDATA WHERE ORDERS_ID = ? AND TRANSACTION_TYPE = ? AND
RECORD_TYPE =

Thanks

Rajib
If there is unique index access, no lock escalation, no next key
issues and appropriate commits plus the rows are different there
should be no issue unless there is an issue with RI and supporting
indices. Add "for read only" to the select as it reduces the lock
level. DB2 is conservative with its locks an will assume an intent to
update unless this is not clear from the SQL statement. Check that it
isn't a repeatable read issue. The read only will help with this.
Jun 28 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
7
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
8
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
17
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.