473,657 Members | 3,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 .DB2SimpleDataS ource 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:

DB2SimpleDataSo urce db2ds = (DB2SimpleDataS ource)dsource;
db2ds.setDataba seName(dbName);
db2ds.setPortNu mber(serverPort );
db2ds.setServer Name(dbHost);
db2ds.setUser(u serName);
db2ds.setPasswo rd(password);
Connection = db2ds.getConnec tion();

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:3 0)
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:1 041)
at com.ibm.db2.jcc .a.s.a(s.java:1 89)
at com.ibm.db2.jcc .a.jf.c(jf.java :311)
at com.ibm.db2.jcc .a.jf.next(jf.j ava: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.jdb c.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 5765
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 .DB2SimpleDataS ource 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:

DB2SimpleDataSo urce db2ds = (DB2SimpleDataS ource)dsource;
db2ds.setDataba seName(dbName);
db2ds.setPortNu mber(serverPort );
db2ds.setServer Name(dbHost);
db2ds.setUser(u serName);
db2ds.setPasswo rd(password);
Connection = db2ds.getConnec tion();

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:3 0)
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:1 041)
at com.ibm.db2.jcc .a.s.a(s.java:1 89)
at com.ibm.db2.jcc .a.jf.c(jf.java :311)
at com.ibm.db2.jcc .a.jf.next(jf.j ava: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.jdb c.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.c omwrote:
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 .DB2SimpleDataS ource 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:
DB2SimpleDataSo urce db2ds = (DB2SimpleDataS ource)dsource;
db2ds.setDataba seName(dbName);
db2ds.setPortNu mber(serverPort );
db2ds.setServer Name(dbHost);
db2ds.setUser(u serName);
db2ds.setPasswo rd(password);
Connection = db2ds.getConnec tion();
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:3 0)
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:1 041)
at com.ibm.db2.jcc .a.s.a(s.java:1 89)
at com.ibm.db2.jcc .a.jf.c(jf.java :311)
at com.ibm.db2.jcc .a.jf.next(jf.j ava: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.jdb c.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
3318
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 below suggests that this problem might now be fixed by Borland. Best regards, Heikki Tuuri
16
8920
by: Nid | last post by:
How do I do row-level locking on SQL Server? Thanks, Nid
8
2570
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 DB2 Personal Edition so I am trying to connect to the database SQLPROCS on this same machine. I've checked the manual and am imitating the examples as well as I can but the examples are geared to remote machines, not the local one, so I strongly...
0
17771
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 Mariani, performance architect for the Microsoft® .NET runtime and longtime Microsoft developer, mentioned to Dr. GUI in an e-mail conversation recently that a fairly common practice (and one that's, unfortunately, described in some of our...
1
1798
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 to retrieve the detail for each one as they are clicked. Rather frustrating. This person was getting out of memory conditions inserting rows when the data in the bytea field was larger than approx. 1400 Kb. This person had posted a fix...
1
2015
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 password has a "|" character in it. If I do this, I get an exception stating that the password is invalid. This is what I execute ...
669
25858
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 paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
33
5048
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 actual counting. Here is the latter's definition: // --- Begin ReferenceCountable.h ---------- class ReferenceCountable
9
2598
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 shared between 4 staff memebers. Each staff computer has a copy of the front-end (linked tables, forms, and queries). They basically only use one form. The form works like this
0
8820
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5630
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.