db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r632088 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java
Date Thu, 28 Feb 2008 18:57:36 GMT
Author: kristwaa
Date: Thu Feb 28 10:57:28 2008
New Revision: 632088

URL: http://svn.apache.org/viewvc?rev=632088&view=rev
Log:
DERBY-3326: Introduce a caching logical connection and logical prepared statement in the client
driver.
Enabled the use of the cache session data, more specifically the current schema name.
Patch file: derby-3326-8a-use_session_data_caching.diff

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java?rev=632088&r1=632087&r2=632088&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/StatementCacheInteractor.java
Thu Feb 28 10:57:28 2008
@@ -28,8 +28,6 @@
  */
 public final class StatementCacheInteractor {
 
-    /** TODO: Fetch from connection, see DERBY-3192. */
-    private final String currentSchema = "APP";
     /** Statement cache for the associated physical connection. */
     private final JDBCStatementCache cache;
     /**
@@ -62,7 +60,8 @@
     public synchronized PreparedStatement prepareStatement(String sql)
             throws SQLException {
         StatementKey stmtKey = StatementKeyFactory.newPrepared(
-                sql, currentSchema, physicalConnection.holdability());
+                sql, physicalConnection.getCurrentSchemaName(),
+                physicalConnection.holdability());
         PreparedStatement ps = cache.getCached(stmtKey);
         if (ps == null) {
             ps = physicalConnection.prepareStatement(sql);
@@ -79,8 +78,8 @@
                                                 int resultSetConcurrency)
             throws SQLException {
         StatementKey stmtKey = StatementKeyFactory.newPrepared(
-                sql, currentSchema, resultSetType, resultSetConcurrency,
-                physicalConnection.holdability());
+                sql, physicalConnection.getCurrentSchemaName(), resultSetType,
+                resultSetConcurrency, physicalConnection.holdability());
         PreparedStatement ps = cache.getCached(stmtKey);
         if (ps == null) {
             ps = physicalConnection.prepareStatement(
@@ -99,8 +98,8 @@
                                                 int resultSetHoldability)
             throws SQLException {
         StatementKey stmtKey = StatementKeyFactory.newPrepared(
-                sql, currentSchema, resultSetType, resultSetConcurrency,
-                resultSetHoldability);
+                sql, physicalConnection.getCurrentSchemaName(), resultSetType,
+                resultSetConcurrency, resultSetHoldability);
 
         PreparedStatement ps = cache.getCached(stmtKey);
         if (ps == null) {
@@ -118,8 +117,8 @@
                                                 int autoGeneratedKeys)
             throws SQLException {
         StatementKey stmtKey = StatementKeyFactory.newPrepared(
-                sql, currentSchema, physicalConnection.getHoldability(),
-                autoGeneratedKeys);
+                sql, physicalConnection.getCurrentSchemaName(),
+                physicalConnection.getHoldability(), autoGeneratedKeys);
         PreparedStatement ps = cache.getCached(stmtKey);
         if (ps == null) {
             ps = physicalConnection.prepareStatement(sql, autoGeneratedKeys);
@@ -133,7 +132,8 @@
     public synchronized CallableStatement prepareCall(String sql)
             throws SQLException {
         StatementKey stmtKey = StatementKeyFactory.newCallable(
-                sql, currentSchema, physicalConnection.holdability());
+                sql, physicalConnection.getCurrentSchemaName(),
+                physicalConnection.holdability());
         CallableStatement cs = (CallableStatement)cache.getCached(stmtKey);
         if (cs == null) {
             cs = physicalConnection.prepareCall(sql);
@@ -149,8 +149,8 @@
                                                       int resultSetConcurrency)
             throws SQLException {
         StatementKey stmtKey = StatementKeyFactory.newCallable(
-                sql, currentSchema, resultSetType, resultSetConcurrency,
-                physicalConnection.holdability());
+                sql, physicalConnection.getCurrentSchemaName(), resultSetType,
+                resultSetConcurrency, physicalConnection.holdability());
         CallableStatement cs = (CallableStatement)cache.getCached(stmtKey);
         if (cs == null) {
             cs = physicalConnection.prepareCall(sql, resultSetType, resultSetConcurrency);
@@ -167,8 +167,8 @@
                                                       int resultSetHoldability)
             throws SQLException {
         StatementKey stmtKey = StatementKeyFactory.newCallable(
-                sql, currentSchema, resultSetType, resultSetConcurrency,
-                resultSetHoldability);
+                sql, physicalConnection.getCurrentSchemaName(), resultSetType,
+                resultSetConcurrency, resultSetHoldability);
         CallableStatement cs = (CallableStatement)cache.getCached(stmtKey);
         if (cs == null) {
             cs = physicalConnection.prepareCall(sql, resultSetType, resultSetConcurrency,



Mime
View raw message