Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deadlocks & such

Status
Not open for further replies.

jemminger

Programmer
Jun 25, 2001
3,453
US
sorry if this is a bit vague...looking for some best practices:

we're developing an app using servlets & jsp, roughly adhering to MVC2 architecture

recently we began experiencing deadlocks during some database transactions, connection sharing where one record was updated with another record's info (we're using a threaded connection pool)

and other odd behavior like POST requests not responding for some servlets but GET is fine.

should we be doing anything like synchronizing all database calls?



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Obviously it all depends on your database config, but generally, if two concurrent processes attempt to lock a table for update at the same time, you will hang the connection. As a rule, all update/insert statements should be sycronized client side for safety, OR, your db should handle this synchronisation.

--------------------------------------------------
Free Database Connection Pooling Software
 
thanks for the info - i'll make our inserts and updates synchronized and see if that solves the problem.


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top