aspose file tools*
The moose likes JDBC and the fly likes How to eliminate deadlock or timeout in a jdbc application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to eliminate deadlock or timeout in a jdbc application?" Watch "How to eliminate deadlock or timeout in a jdbc application?" New topic
Author

How to eliminate deadlock or timeout in a jdbc application?

John Peter
Greenhorn

Joined: Jul 13, 2004
Posts: 8
Dear all,
My web application hits deadlock or timeout problems during select/insert/update/delete operation in the
database especially concurrent testing with 100 virtual users.

May I know how to avoid these two errors?

Could I said that these solutions will apply when the load volumn is 1000 users, 10000 users ...etc ?

All workable solutions are welcome.

Regards,
John
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Make your transaction shorter. Committing transactions frequently would probably save you from this kinda behavior.
[ March 06, 2005: Message edited by: Adeel Ansari ]
John Peter
Greenhorn

Joined: Jul 13, 2004
Posts: 8
May I know how to shorter the transaction?
Reconstruct the logic, or ?

Please enlighten me in detail. E.g: Simple code to illustrate it.

Rgds,
John
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"Spider Peter",
sorry but your display name is not valid according to our name rules.

We require display names to be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Just to be clear, you cannot have the current display name and then sign it 'John'. We now require you to set the first name in your display name to 'John' and second to be your last name. 'Spider' will not be accepted.

Please edit your profile and correct your profile, since accounts with invalid display names get deleted, often without warning

thanks,
Dave
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Spider Peter:
May I know how to shorter the transaction?
Reconstruct the logic, or ?
Please enlighten me in detail. E.g: Simple code to illustrate it.


make connection.setAutoCommit(true), Or
if don't want to do with auto-commit then do commit frequently.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Thanks for the name change
(It was meant to be a sad face in my previous post, not a happy face. I hope you weren't upset by my mistake!)
Ed Wallen
Ranch Hand

Joined: Feb 11, 2002
Posts: 34
Look at how locking is implemented on your database: row level vs. page level vs. table level. Monitor (at the database level) what threads are making requests for locks against what resources. Are locks escalating as a result? Tune the database to reduce contention. Also, create resource references for your datasources............modify the isolation level according to the nature of the work being performed to get the best performance (example: for select statements against static data, set your isolation level to be read uncommitted).

-Ed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to eliminate deadlock or timeout in a jdbc application?