You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by kr...@apache.org on 2010/10/13 15:43:59 UTC
svn commit: r1022099 -
/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
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;
}