This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dead locks

 
raj joe
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do we avoid dead lock situations in database transactions (J2EE applications).How does JDBC and EJB help us.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing you can do is to always use a DataSource to get your Connection, so avoid DriverManager.getConnection. The use of DriverManager.getConnection can cause a deadlock because in the server all DriverManager calls are class-synchronized (including many frequent calls that all drivers make) and JDBC drivers do a lot of synchronization internally. One long-waiting call can stop all JDBC work in the whole JVM and cause deadlocks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic