commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp TestBasicDataSource.java
Date Sat, 20 Sep 2003 16:59:41 GMT
dirkv       2003/09/20 09:59:41

  Modified:    dbcp/src/test/org/apache/commons/dbcp
                        TestBasicDataSource.java
  Log:
  Bugzilla Bug 23293: setAutoCommit(true) when returning connection to the pool
  - Giving a hint to the database driver that you don't need long running
  transactions
  => junit test
  
  Revision  Changes    Path
  1.11      +20 -3     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestBasicDataSource.java
  
  Index: TestBasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestBasicDataSource.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestBasicDataSource.java	20 Sep 2003 14:29:59 -0000	1.10
  +++ TestBasicDataSource.java	20 Sep 2003 16:59:41 -0000	1.11
  @@ -241,4 +241,21 @@
               c[i].close();
           }
       }
  +    
  +    public void testSetAutoCommitTrueOnClose() throws Exception {
  +        ds.setAccessToUnderlyingConnectionAllowed(true);
  +        ds.setDefaultAutoCommit(false);
  +        
  +        Connection conn = getConnection();
  +        assertNotNull(conn);
  +        assertEquals(false, conn.getAutoCommit());
  +
  +        Connection dconn = ((DelegatingConnection) conn).getInnermostDelegate();
  +        assertNotNull(dconn);
  +        assertEquals(false, dconn.getAutoCommit());
  +
  +        conn.close();
  +
  +        assertEquals(true, dconn.getAutoCommit());
  +    }
   }
  
  
  

Mime
View raw message