tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: Tomcat connection pool - needs to reset autocommit
Date Thu, 13 Nov 2008 15:40:02 GMT
Tim Funk wrote:
> On connection.close() - the pool should ensure that autocommit is 
> reset correctly. Example test case:
>
> // assume autocommit for JDBC verndor is true
that's an interesting assumption, while it probably stands with most 
drivers.
there is a 'defaultAutoCommit' property you can use.
> Connection con = datasource.getConnection();
> System.out.println("con.autoconnect=" + con.getAutoCommit()\n";
> // above line should say true
> con.setAutoCommit(false);
> con.close();
>
> con = datasource.getConnection();
> System.out.println("con.autoconnect=" + con.getAutoCommit()\n";
> // above line will return false instead of true
> con.close();
I will put this into the ConnectionState interceptor, to manage all the 
state.

Filip
>
>
> -Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message