db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r957164 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
Date Wed, 23 Jun 2010 11:31:00 GMT
Author: kristwaa
Date: Wed Jun 23 11:31:00 2010
New Revision: 957164

URL: http://svn.apache.org/viewvc?rev=957164&view=rev
Log:
DERBY-4653: Avoid unnecessary round-trip for commit in the client driver

Removed unused argument and set autocommit to false in the test.

Patch contributed by Lily Wei (lilywei at yahoo dot com).

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java?rev=957164&r1=957163&r2=957164&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
Wed Jun 23 11:31:00 2010
@@ -2082,20 +2082,20 @@ public class J2EEDataSourceTest extends 
         PooledConnection pc = ds.getPooledConnection();
         Connection conn = pc.getConnection();
 
-        testConnectionFlowCommitWork(conn, 1);
+        testConnectionFlowCommitWork(conn);
         conn.close();
         
         //Test for XADataSource
         XADataSource xs = J2EEDataSource.getXADataSource();
         XAConnection xc = xs.getXAConnection();
         conn = xc.getConnection();
-        testConnectionFlowCommitWork(conn, 1);
+        testConnectionFlowCommitWork(conn);
         conn.close();
         
         //Test for DataSource
         DataSource jds = JDBCDataSource.getDataSource();
         conn = jds.getConnection();
-        testConnectionFlowCommitWork(conn, 1);
+        testConnectionFlowCommitWork(conn);
         conn.close();       
     }
 
@@ -2104,8 +2104,9 @@ public class J2EEDataSourceTest extends 
      * @param conn
      * @throws SQLException
      **/  
-    private void testConnectionFlowCommitWork(Connection conn, int expectednumtransaction)
throws SQLException {
+    private void testConnectionFlowCommitWork(Connection conn) throws SQLException {
         //DERBY 4653 - make sure commit with no work does not flow in client
+        conn.setAutoCommit(false);
         int startXactId = getClientTransactionID(conn);
         Statement s = conn.createStatement();
         ResultSet rs = s.executeQuery("values 1");



Mime
View raw message