|
From: Steve E. <ste...@jb...> - 2006-07-20 14:21:32
|
Hehe. That obviously will not work ;)
-----Original Message-----
From: ja...@he... [mailto:ja...@he...]=20
Sent: Thursday, July 20, 2006 9:13 AM
To: Steve Ebersole
Cc: hib...@li...; ja...@he...
Subject: Re: [Hibernate] Connection Handling in Isolater
Hello Steve,
thanks for the quick reply. Since I didn't notice you've moved to SVN
I've checked the "latest" version from CVS (via the web CVS View) ;-)
Rgds
Holger
Steve Ebersole wrote:
>Yep. This has already been fixed for almost two months now in SVN ;)
>
>-----Original Message-----
>From: hib...@li...
>[mailto:hib...@li...] On Behalf Of
>ja...@he...
>Sent: Thursday, July 20, 2006 8:35 AM
>To: hib...@li...
>Cc: ja...@he...
>Subject: [Hibernate] Connection Handling in Isolater
>
>Hi all,
>
>I think org.hibernate.engine.transaction.Isolater is not handling
>connections properly:
>
>The method JdbcDelegate is currently implemented as follows:
>
> public static class JdbcDelegate implements Delegate {
> ...
> public void delegateWork(IsolatedWork work) throws
>HibernateException {
> Connection connection =3D null;
> try {
> connection =3D
>session.getBatcher().openConnection();
> ...
> }
> ...
> }
> finally {
> if ( wasAutoCommit ) {
> try {
>=09
>connection.setAutoCommit( true );
> }
> catch( Throwable ignore ) {
> log.trace( "was unable
>to reset connection back to auto-commit" );
> }
>=09
>session.getBatcher().closeConnection( connection );
> }
> }
> }
> }
>
>
>This means that the connection will only be closed if
>wasAutoCommit=3D=3Dtrue but I think it should be closed in any
circumstance:
>
>
> public static class JdbcDelegate implements Delegate {
> ...
> public void delegateWork(IsolatedWork work) throws
>HibernateException {
> Connection connection =3D null;
> try {
> connection =3D
>session.getBatcher().openConnection();
> ...
> }
> ...
> }
> finally {
> if ( wasAutoCommit ) {
> try {
>=09
>connection.setAutoCommit( true );
> }
> catch( Throwable ignore ) {
> log.trace( "was unable
>to reset connection back to auto-commit" );
> }
> }
> session.getBatcher().closeConnection(
>connection );
> }
> }
> }
>
>What do you think ?=20
>
--=20
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
|