db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r671128 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
Date Tue, 24 Jun 2008 11:09:02 GMT
Author: kristwaa
Date: Tue Jun 24 04:09:02 2008
New Revision: 671128

URL: http://svn.apache.org/viewvc?rev=671128&view=rev
Log:
DERBY-3723: Reset current schema to default (user name) when creating a new logical connection
in the client driver.
Resets the schema to the associated user name for the physical connection when creating a
new logical connection (which is currently implemented as resetting the physical connection).
Also made 'Connection.user_' final.
Patch file: derby-3723-1a-client_schema_reset.diff

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.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=671128&r1=671127&r2=671128&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 Jun 24
04:09:02 2008
@@ -61,7 +61,7 @@
     // ------------------------properties set for life of connection--------------
 
     // See ClientDataSource pre-connect settings
-    public transient String user_;
+    protected final String user_;
     public boolean retrieveMessageText_;
     protected boolean jdbcReadOnly_;
     /**
@@ -171,7 +171,8 @@
                          String password,
                          org.apache.derby.jdbc.ClientBaseDataSource dataSource) 
                                                            throws SqlException {
-        initConnection(logWriter, user, dataSource);
+        this.user_ = user;
+        initConnection(logWriter, dataSource);
     }
 
     protected Connection(org.apache.derby.client.am.LogWriter logWriter,
@@ -180,21 +181,19 @@
                          boolean isXAConn,
                          org.apache.derby.jdbc.ClientBaseDataSource dataSource) 
                                                            throws SqlException {
+        this.user_ = user;
         isXAConnection_ = isXAConn;
-        initConnection(logWriter, user, dataSource);
+        initConnection(logWriter, dataSource);
     }
 
     // For jdbc 2 connections
     protected void initConnection(org.apache.derby.client.am.LogWriter logWriter,
-                                  String user,
                                   org.apache.derby.jdbc.ClientBaseDataSource
                                             dataSource) throws SqlException {
         if (logWriter != null) {
             logWriter.traceConnectEntry(dataSource);
         }
 
-        user_ = user;
-
         // Extract common properties.
         // Derby-409 fix - Append connectionAttributes only if it is non-null. 
         // DERBY-1130 - Append connectionAttributes only if database name is
@@ -280,7 +279,8 @@
         // if needed this will later be initialized by NET calls to initializePublicKeyForEncryption()
         encryptionManager_ = null;
 
-        currentSchemaName_ = null;
+        // DERBY-3723: Reset schema to user name.
+        currentSchemaName_ = this.user_;
         autoCommit_ = true;
         inUnitOfWork_ = false;
         holdability = ResultSet.HOLD_CURSORS_OVER_COMMIT;



Mime
View raw message