473,549 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

different lock behaviour with forward only and static cursors in DB2 V9 via ODBC

Hello,

I 'm working with an IBM DB2 V9 database via ODBC/CLI.
I've got a problem with different lock behaviour in the following
constellation / configuration.

1) connection C1 and connection C2 access table T1
2) STMT1 is a statementhandle of C1 and STMT2 is a statementhandle of
C2
3) the TXN_ISOLATION_L EVEL is SQL_TXN_READ_CO MMITTED (Cursor
Stability) for both connections
4) both connections work in AUTOCOMMIT_MODE
5) table T1 contains of three Rows (R1, R2, R3)

6) the two connections executes actions in the following time order:

a) C1: opens a result set / cursor with "SELECT * FROM T1"

b) C1: fetch of row R1 with open cursor on STMT1

c) C1: fetch of row R2 with open cursor on STMT1

d) C2 (!!!): DELETE-Stmt for row R2 in T1 (actually fetched by
C1,STMT1)

Now it depends on the statementHandle-configuration whether the DELETE
of R2 produces a deadlock-situation or not.

If i configure STMT1 and STMT2 as follows then it works fine and there
is no deadlock.

first config (no deadlock):
SQL_ATTR_CURSOR _SENSITIVITY set to SQL_INSENSITIVE
SQL_ATTR_CURSOR _TYPE set to SQL_CURSOR_STAT IC
SQL_ATTR_CONCUR RENCY set to SQL_CONCUR_READ _ONLY

But the second variant causes a deadlock.

second config (deadlock):
SQL_ATTR_CURSOR _SENSITIVITY set to SQL_INSENSITIVE ,
SQL_ATTR_CURSOR _TYPE set to SQL_CURSOR_FORW ARD_ONLY
SQL_ATTR_CONCUR RENCY set to SQL_CONCUR_READ _ONLY

I can't use the first config because it is to slow (SQL_CURSOR_STA TIC
is scrollable in DB2, that's slow).
So i have to use the first config but i can't understand the
difference of the cursor attributes that causes the deadlock.

Has anyone an idea how to use SQL_CURSOR_FORW ARD_ONLY cursors without
a deadlock in the described situation?

Thanks,

Marc

Apr 13 '07 #1
0 1423

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

Similar topics

4
7224
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript to make ODBC calls to the db. The particular system I'm working with, will not work with an Oracle stored procedure I'm told. However, it
4
6021
by: xeqister | last post by:
Greetings, We are connecting to a DB2 database residing on an AIX machine via JDBC. In order to lock some row of records, we use the "select . . . for update . . . " Java statement: In a multi user environment, we find that once a user locks the rows of records, another user executing the "select ... for update . . . " statement will...
22
3279
by: Marc Mones | last post by:
Hello, I'working with IBM DB2 V8.1 and CLI/ODBC. I've got a problem with the following statement: ******************************************************************************** SELECT S_ART, S_SPRACHE, S_MANDANT, S_NR, S_SUB, S_OWNER, S_SATZ FROM SY0001_00005 WHERE S_ART = ? AND S_SPRACHE = ? AND S_MANDANT = ? AND S_NR = ? AND
7
703
by: Sunny | last post by:
Hi, I can not understend completely the lock statement. Actally what is locked: 1. the part of the code between {...} or 2. the object in lock() In the docs is written: for 1: The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a
0
3160
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and implementation, data abstraction layer. But because each data adapter in the implementation layer has a connection object that opens and closes as...
2
2616
by: Bob | last post by:
We currently have an application running on .NET 1.1. It hashes certain data using System.Security.Cryptography.SHA1Managed class. It has worked out fine until we upgraded the app to .NET 2.0. SHA1Managed in 2.0 hashes to a different stirng output when the input is exactly the same. Why would this be the case? I thought the SHA1 algorithm...
3
2288
by: schwartzenberg | last post by:
Dear friends, I have just run into a strange DB2 problem. Something i'd some of you would answer, if only shortly. My basic question is: How do i ensure 'insensitive' (ie static) cursors that are only forward readable (in DB2 for mainframe)?? It seems that the cursors i'm working on suddenly have become (after
5
1545
by: Marco van de Voort | last post by:
Hi, does sb recognize (aspects of) the following problem? Or better, know a solution or direction to search? At work I've inherited a series of delphi applications that access a common database using SQL Server 2000 (sp3, sp4 update in preparation due to this problem). Applications run on one server, db on the second. Both are dual xeon...
94
30226
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock Statement (C# Reference) statement to serialize access. " But when is it better to use "volatile" instead of "lock" ?
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7959
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7810
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5369
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
764
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.