Re: JDBC transaction isolation
On 5/3/2012 2:43 PM, markspace wrote:
On 5/3/2012 8:53 AM, Arne Vajh?j wrote:
You let the database do it - not the driver.
Yes, OK. Driver/DB thing. At some lower level than my app.
It is a classic database topic.
Hmm, I'll try to find some other sources then, if it's a general topic
and not restricted to JDBC implementations.
It is not.
ADO.NET has it at provider level:
http://msdn.microsoft.com/en-us/library/system.data.isolationlevel.aspx
Almost all database have it at the SQL level:
http://dev.mysql.com/doc/refman/5.5/en/set-transaction.html
http://www.postgresql.org/docs/9.1/static/sql-set-transaction.html and
http://www.postgresql.org/docs/9.1/static/transaction-iso.html
http://msdn.microsoft.com/en-us/library/ms173763.aspx
http://docs.oracle.com/cd/B10500_01/server.920/a96524/c21cnsis.htm
The code is good in the sense that it will prevent duplicates.
For more serious usage you should consider to retry a couple of times
in case of a transaction timeout.
Ah, ok. Something else to check into. Thanks!
Which will be a good excuse to look into the different
sub classes of SQLException and transient versus
non transient.
Arne