Hibernate 3.0 used with serializable isolation DB

James <[email protected]> Sun, 10 Jul 2005 12:06:48 -0700 (PDT)
Newsgroups gmane.comp.db.mckoi
Message-ID <[email protected]>
Here is the posted Hibernate forum message.

  http://forum.hibernate.org/viewtopic.php?t=944864

I'm waiting for feedback and any is appreciated.

This forum message has my implementation of solution
to reduce odds of 'concurrent serializable transaction
conflict' occurring, in a connection pooled
environment.

The solution is to cause an explicit connection commit
or rollback to occur at the beginning of every
Hibernate transaction--I.e. when
Session.beginTransaction() is called.  This ensures
that the connection associated with Hibernate session
is working with the freshest possible image/view of
the database schema, before it does any work.  (This
is implemented by extending JDBCTransaction and
overriding begin() method)

I've tried transaction class on Hibernate example
'build eg'--with Mckoi--and the example completes
successfully.

Note: that setting /etc/hibernate.properties
autocommit to true it not an acceptable 'fix'. 
Usually there are multiple insert/update/delete
statements within a single Hibernate transaction.  If
the connection is autocommit=true, then each DML
statement is being commited individually and Hibernate
will have lost the ability to rollback to what should
be the beginning of the transaction.



---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to [email protected]