This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
How to eliminate deadlock or timeout in a jdbc application?
John Peter
Greenhorn
Joined: Jul 13, 2004
Posts: 8
posted
0
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
posted
0
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
posted
0
May I know how to shorter the transaction? Reconstruct the logic, or ?
Please enlighten me in detail. E.g: Simple code to illustrate it.
"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
posted
0
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.
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
posted
0
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How to eliminate deadlock or timeout in a jdbc application?