473,396 Members | 1,892 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,396 software developers and data experts.

jcc type 4 driver locking issue

Hi,

I am seeing different hang/deadlock behavior with 2 different JDBC
connection methods.

METHOD A
-------------------
I am using the com.ibm.db2.jcc.DB2SimpleDataSource from the db2jcc jar
files shipped with version 8.1.11. I am using this datasource to
connect to a 8.1.2.104 FP11 db2 remote database server and connect
with the following code:

DB2SimpleDataSource db2ds = (DB2SimpleDataSource)dsource;
db2ds.setDatabaseName(dbName);
db2ds.setPortNumber(serverPort);
db2ds.setServerName(dbHost);
db2ds.setUser(userName);
db2ds.setPassword(password);
Connection = db2ds.getConnection();

With this connection I have 2 non-commited inserts for table A. With a
different connection I attempt a select from table A, and the select
hangs, then this exception is thrown (deadlock?)

com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -911,
SQLSTATE: 40001, SQLERRMC: 68
at com.ibm.db2.jcc.a.jf.b(jf.java:3198)
at com.ibm.db2.jcc.b.kb.i(kb.java:220)
at com.ibm.db2.jcc.b.kb.a(kb.java:180)
at com.ibm.db2.jcc.b.kb.a(kb.java:35)
at com.ibm.db2.jcc.b.x.a(x.java:30)
at com.ibm.db2.jcc.b.j.Fb(j.java:331)
at com.ibm.db2.jcc.a.jf.R(jf.java:3041)
at com.ibm.db2.jcc.b.d.f(d.java:1041)
at com.ibm.db2.jcc.a.s.a(s.java:189)
at com.ibm.db2.jcc.a.jf.c(jf.java:311)
at com.ibm.db2.jcc.a.jf.next(jf.java:283)
METHOD B
---------------------
This time I connect to the SAME database, with the same application
and run through the exact same code sequence that hangs via method A
above, HOWEVER no deadlock occurs. Here I use the
COM.ibm.db2.jdbc.app.DB2Driver driver which connects via the locally
installed DB2 admin client installed on the application server.

What is the difference here with the drivers that would be causing
this??
Via this mehod

Feb 9 '07 #1
3 5755
On Feb 9, 10:00 am, inter...@yahoo.com wrote:
Hi,

I am seeing different hang/deadlock behavior with 2 different JDBC
connection methods.

METHOD A
-------------------
I am using the com.ibm.db2.jcc.DB2SimpleDataSource from the db2jcc jar
files shipped with version 8.1.11. I am using this datasource to
connect to a 8.1.2.104 FP11 db2 remote database server and connect
with the following code:

DB2SimpleDataSource db2ds = (DB2SimpleDataSource)dsource;
db2ds.setDatabaseName(dbName);
db2ds.setPortNumber(serverPort);
db2ds.setServerName(dbHost);
db2ds.setUser(userName);
db2ds.setPassword(password);
Connection = db2ds.getConnection();

With this connection I have 2 non-commited inserts for table A. With a
different connection I attempt a select from table A, and the select
hangs, then this exception is thrown (deadlock?)

com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -911,
SQLSTATE: 40001, SQLERRMC: 68
at com.ibm.db2.jcc.a.jf.b(jf.java:3198)
at com.ibm.db2.jcc.b.kb.i(kb.java:220)
at com.ibm.db2.jcc.b.kb.a(kb.java:180)
at com.ibm.db2.jcc.b.kb.a(kb.java:35)
at com.ibm.db2.jcc.b.x.a(x.java:30)
at com.ibm.db2.jcc.b.j.Fb(j.java:331)
at com.ibm.db2.jcc.a.jf.R(jf.java:3041)
at com.ibm.db2.jcc.b.d.f(d.java:1041)
at com.ibm.db2.jcc.a.s.a(s.java:189)
at com.ibm.db2.jcc.a.jf.c(jf.java:311)
at com.ibm.db2.jcc.a.jf.next(jf.java:283)

METHOD B
---------------------
This time I connect to the SAME database, with the same application
and run through the exact same code sequence that hangs via method A
above, HOWEVER no deadlock occurs. Here I use the
COM.ibm.db2.jdbc.app.DB2Driver driver which connects via the locally
installed DB2 admin client installed on the application server.

What is the difference here with the drivers that would be causing
this??

Via this mehod
The RC 68 is a locktimeout, not a deadlock. The amount of time that a
statement waits for a lock to be released before getting a -911 RC 68
depends on the LOCKTIMEOUT database parameter. A deadlock would be RC
2.

I suspect that the second connection type has auto-commit turned on by
default.

Feb 9 '07 #2
Hi,

auto commit is turned OFF on both connection methods I described

On Feb 9, 10:12 am, "Mark A" <m00...@yahoo.comwrote:
On Feb 9, 10:00 am, inter...@yahoo.com wrote:
Hi,
I am seeing different hang/deadlock behavior with 2 different JDBC
connection methods.
METHOD A
-------------------
I am using the com.ibm.db2.jcc.DB2SimpleDataSource from the db2jcc jar
files shipped with version 8.1.11. I am using this datasource to
connect to a 8.1.2.104 FP11 db2 remote database server and connect
with the following code:
DB2SimpleDataSource db2ds = (DB2SimpleDataSource)dsource;
db2ds.setDatabaseName(dbName);
db2ds.setPortNumber(serverPort);
db2ds.setServerName(dbHost);
db2ds.setUser(userName);
db2ds.setPassword(password);
Connection = db2ds.getConnection();
With this connection I have 2 non-commited inserts for table A. With a
different connection I attempt a select from table A, and the select
hangs, then this exception is thrown (deadlock?)
com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -911,
SQLSTATE: 40001, SQLERRMC: 68
at com.ibm.db2.jcc.a.jf.b(jf.java:3198)
at com.ibm.db2.jcc.b.kb.i(kb.java:220)
at com.ibm.db2.jcc.b.kb.a(kb.java:180)
at com.ibm.db2.jcc.b.kb.a(kb.java:35)
at com.ibm.db2.jcc.b.x.a(x.java:30)
at com.ibm.db2.jcc.b.j.Fb(j.java:331)
at com.ibm.db2.jcc.a.jf.R(jf.java:3041)
at com.ibm.db2.jcc.b.d.f(d.java:1041)
at com.ibm.db2.jcc.a.s.a(s.java:189)
at com.ibm.db2.jcc.a.jf.c(jf.java:311)
at com.ibm.db2.jcc.a.jf.next(jf.java:283)
METHOD B
---------------------
This time I connect to the SAME database, with the same application
and run through the exact same code sequence that hangs via method A
above, HOWEVER no deadlock occurs. Here I use the
COM.ibm.db2.jdbc.app.DB2Driver driver which connects via the locally
installed DB2 admin client installed on the application server.
What is the difference here with the drivers that would be causing
this??
Via this mehod

The RC 68 is a locktimeout, not a deadlock. The amount of time that a
statement waits for a lock to be released before getting a -911 RC 68
depends on the LOCKTIMEOUT database parameter. A deadlock would be RC
2.

I suspect that the second connection type has auto-commit turned on by
default.

Feb 9 '07 #3
Show the JDBC code, including (I suspect) the parameter-setting
and the variable values. Sometimes a driver has data-encoding
defaults that will require a type-conversion by the DBMS, which
stops it from using an index, and must instead do a table search,
which takes longed and might require locks that an index query
would not.
As an experiment, try sending the calls as a complete SQL
string, including the variable values, instead of via setXXX().

Joe Weinstein at BEA Systems
Feb 9 '07 #4

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

Similar topics

0
by: Heikki Tuuri | last post by:
Hi! Many people have complained over years that Borland's dbExpress driver does not work with MySQL and transactions, because it disconnects from mysqld after each SQL statement. The postings...
16
by: Nid | last post by:
How do I do row-level locking on SQL Server? Thanks, Nid
8
by: Rhino | last post by:
I'm trying to use the JDBC Universal driver to get a Type 4 connection in a Java client program running under DB2 V8.2.1 but I keep getting a "connection refused: connect" message. I'm running...
0
by: Nashat Wanly | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui06032003.asp Don't Lock Type Objects! Why Lock(typeof(ClassName)) or SyncLock GetType(ClassName) Is Bad Rico...
1
by: Sailer, Denis | last post by:
There was a posting in the mailing list archives that I can't find anymore. The web site right now is presenting a list of items from a search in a reasonable amount of time, but takes 5-10 minutes...
1
by: nielsgron | last post by:
Hi, I am using the DB2 Type 4 JDBC Driver to connect to my DB2 8.2 for Windows server. Everything works perfectly unless I have a password with the pipe character ( "|" ) in it. The server...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
33
by: Ney Andr de Mello Zunino | last post by:
Hello. I have written a simple reference-counting smart pointer class template called RefCountPtr<T>. It works in conjunction with another class, ReferenceCountable, which is responsible for the...
9
by: zmickle | last post by:
Experts and books all say that you can share an Access back end on a shared drive with the front end running on each host computer. I have a simple database that tracks student data and it is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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 projectplanning, coding, testing,...

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.