Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to eliminate deadlock or timeout in a jdbc application?

 
John Peter
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic