commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: [DBCP] Are connection properties reset when returning to pool ?
Date Sun, 30 Nov 2003 17:29:33 GMT
Yes, the following properties are reset on each getConnection.
    setAutoCommit
    setReadOnly
    setTransactionIsolation
    setCatalog

-- Dirk

John Zoetebier wrote:
> Does DBCP reset properties like AutoCommit ?
> 
> For example a class with 2 methods:
> public void ClientDataModel readClient() {
>     conn = DriverManager.getConnection(Constants.JDBC_URL);
>     // Do I have to set AutoCommit explitly here ?
>     conn.setAutoCommit(true);    // No transaction
>     ...
>     conn.close()
> }
> 
> public void void updateClient(ClientDataModel) {
>     conn = DriverManager.getConnection(Constants.JDBC_URL);
>     // Do I have to set AutoCommit explitly here ?
>     conn.setAutoCommit(false);    // Run in transaction mode
>     ...
>     conn.close()
> }
> 
> Assume that I have only 1 connection in the pool.
> After connection has been closed in a method, is it returned to the next 
> method like it was set in the previous method ?
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message