By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,334 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,334 IT Pros & Developers. It's quick & easy.

Deadlocking in Java program

P: n/a
Hiya,

I've been getting some deadlocking that I've never seen before. I
rewrote just over 10,000 lines of code, so I can't really go back and
comment out what I've done. In a nutshell, could my deadlock be
related to how I'm creating the PreparedStatement? The old code just
called con.prepareStatement(sql), but the new code needed the
ResultSet to be scrollable...

PreparedStatement staGetOpenOrders = con.prepareStatement(sql,
ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);

Also, in the short term, can I set the deadlock timeout to something
shorter than the apparent default? Looks like it's about 3 minutes.

Thanks, JC
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Default deadlock detection time can be changed in the dbm config file.
To see what statements are deadlocking you can use a deadlock event
monitor with details (see the sql ref, 'create event monitor' section).

Johnny wrote:
Hiya,

I've been getting some deadlocking that I've never seen before. I
rewrote just over 10,000 lines of code, so I can't really go back and
comment out what I've done. In a nutshell, could my deadlock be
related to how I'm creating the PreparedStatement? The old code just
called con.prepareStatement(sql), but the new code needed the
ResultSet to be scrollable...

PreparedStatement staGetOpenOrders = con.prepareStatement(sql,
ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);

Also, in the short term, can I set the deadlock timeout to something
shorter than the apparent default? Looks like it's about 3 minutes.

Thanks, JC

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.