Forums Register Login
sql helper class
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?
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.

This thread has been viewed 817 times.

All times above are in ranch (not your local) time.
The current ranch time is
Oct 21, 2018 11:14:31.