db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1060535 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ client/org/apache/derby/client/net/ engine/org/apache/derby/impl/jdbc/
Date Tue, 18 Jan 2011 18:53:45 GMT
Author: rhillegas
Date: Tue Jan 18 18:53:44 2011
New Revision: 1060535

URL: http://svn.apache.org/viewvc?rev=1060535&view=rev
Log:
DERBY-4869: Hide some behavior in the physical connections which we don't want to be visible
to applications.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java?rev=1060535&r1=1060534&r2=1060535&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java Tue Jan 18
18:53:44 2011
@@ -30,7 +30,7 @@ import org.apache.derby.client.net.NetXA
 import org.apache.derby.shared.common.sanity.SanityManager;
 
 public abstract class Connection
-    implements java.sql.Connection, ConnectionCallbackInterface, Runnable
+    implements java.sql.Connection, ConnectionCallbackInterface
 {
     //---------------------navigational members-----------------------------------
 
@@ -2471,31 +2471,11 @@ public abstract class Connection
     public  boolean isAborting() { return aborting_; }
     
     /** Begin aborting the connection */
-    public  void    beginAborting()
+    protected  void    beginAborting()
     {
         aborting_ = true;
         markClosed( false );
     }
     
-	//////////////////////////////////////////////////////////
-    //
-	// Runnable BEHAVIOR
-    //
-    // This class implements Runnable so that the JDBC 4.1 abort(Executor)
-    // method can run the closeX() logic in a separate thread if necessary.
-    //
-	//////////////////////////////////////////////////////////
-
-    public  void    run()
-    {
-        try {
-            rollback();
-            close();
-        } catch (SQLException se)
-        {
-            se.printStackTrace( agent_.getLogWriter() );
-        }
-    }
-    
 
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java?rev=1060535&r1=1060534&r2=1060535&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java Tue Jan
18 18:53:44 2011
@@ -434,10 +434,21 @@ public class  NetConnection40 extends or
         beginAborting();
 
         //
-        // The run() method in Connection does the
-        // actual releasing of resources.
+        // Now pass the Executor a Runnable which does the real work.
         //
-        executor.execute( this );
+        executor.execute
+            (
+             new Runnable()
+             {
+                 public void run()
+                 {
+                     try {
+                         rollback();
+                         close();
+                     } catch (SQLException se) { se.printStackTrace( agent_.getLogWriter()
); }
+                 }
+             }
+             );
     }
 
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?rev=1060535&r1=1060534&r2=1060535&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java Tue Jan
18 18:53:44 2011
@@ -115,10 +115,10 @@ import org.apache.derby.impl.jdbc.authen
  * @see TransactionResourceImpl
  *
  */
-public abstract class EmbedConnection implements EngineConnection, Runnable
+public abstract class EmbedConnection implements EngineConnection
 {
 
-	private static final StandardException exceptionClose = StandardException.closeException();
+	protected static final StandardException exceptionClose = StandardException.closeException();
     
     /**
      * Static exception to be thrown when a Connection request can not
@@ -1891,7 +1891,7 @@ public abstract class EmbedConnection im
 	//
 	// NOTE: This method is not part of JDBC specs.
 	//
-    private void close(StandardException e) throws SQLException {
+    protected void close(StandardException e) throws SQLException {
 		
 		synchronized(getConnectionSynchronization())
 		{
@@ -3330,27 +3330,10 @@ public abstract class EmbedConnection im
     public  boolean isAborting() { return aborting; }
 
     /** Begin aborting the connection */
-    public  void    beginAborting()
+    protected  void    beginAborting()
     {
         aborting = true;
         setInactive();
     }
-    
-	//////////////////////////////////////////////////////////
-    //
-	// Runnable BEHAVIOR
-    //
-    // This class implements Runnable so that the JDBC 4.1 abort(Executor)
-    // method can run the close() logic in a separate thread if necessary.
-    //
-	//////////////////////////////////////////////////////////
-
-    public  void    run()
-    {
-        try {
-            rollback();
-            close(exceptionClose);
-        } catch (SQLException se) { Util.logSQLException( se ); }
-    }
-    
+        
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java?rev=1060535&r1=1060534&r2=1060535&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java Tue
Jan 18 18:53:44 2011
@@ -301,10 +301,21 @@ public class EmbedConnection40 extends E
         beginAborting();
 
         //
-        // The run() method in EmbedConnection does the
-        // actual releasing of resources.
+        // Now pass the Executor a Runnable which does the real work.
         //
-        executor.execute( this );
+        executor.execute
+            (
+             new Runnable()
+             {
+                 public void run()
+                 {
+                     try {
+                         rollback();
+                         close(exceptionClose);
+                     } catch (SQLException se) { Util.logSQLException( se ); }
+                 }
+             }
+             );
     }
     
 }



Mime
View raw message