db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r1022099 - /db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
Date Wed, 13 Oct 2010 13:43:59 GMT
Author: kristwaa
Date: Wed Oct 13 13:43:59 2010
New Revision: 1022099

URL: http://svn.apache.org/viewvc?rev=1022099&view=rev
Log:
DERBY-4843: Consult isPoolable hint before caching prepared statement

Only cache a prepared statement if the poolable hint is set to true (default).

Patch file: derby-4843-1b-consult_isPoolable.diff

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

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java?rev=1022099&r1=1022098&r2=1022099&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
Wed Oct 13 13:43:59 2010
@@ -165,8 +165,14 @@ abstract class LogicalStatementEntity
             this.owner = null;
             // Reset the owner of the physical statement.
             temporaryPsRef.setOwner(null);
+            // NOTE: Accessing ps state directly below only to avoid tracing.
             // If the underlying statement has become closed, don't cache it.
-            if (temporaryPsRef.isClosed()) {
+            if (!temporaryPsRef.openOnClient_) {
+                return;
+            }
+            // If the poolable hint is false, don't cache it.
+            if (!temporaryPsRef.isPoolable) {
+                temporaryPsRef.close();
                 return;
             }
 



Mime
View raw message