Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql helper class

 
Matt Wielbut
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a class that only contains static methods in the form

that all the servelts use to execute SQL statements.
I use a connection pool that is thread safe to get DB connections but do these methods need to be synchronized also. The rule I've always followed is, if multilple threads are mutating a variable then make the code synchronized. Is this correct?
 
ib idris
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
any decent DB has safeguards against data corruption. The JDBC an Servlets desingers have also thought about this kind of problems. But to be safe you sould make backups and turn autocommit off.
http://galileo.spaceports.com/~ibidris/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic