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 dj...@apache.org on 2007/11/27 20:17:50 UTC
svn commit: r598737 -
/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
Author: djd
Date: Tue Nov 27 11:17:49 2007
New Revision: 598737
URL: http://svn.apache.org/viewvc?rev=598737&view=rev
Log:
Remove unnecessary closing of result set in EmbedStatement execute method since it will have already have been closed by clearResultSets() method.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java?rev=598737&r1=598736&r2=598737&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java Tue Nov 27 11:17:49 2007
@@ -1159,22 +1159,25 @@
// the prepared statement.
synchronized (getConnectionSynchronization()) {
+
+ if (SanityManager.DEBUG)
+ {
+ // Ensure that clearResultSets has been called
+ // to fulfill [JDBC4: section 15.2.5 ]
+ // A ResultSet object is implicitly closed when:
+ // The associated Statement object is re-executed
+
+ SanityManager.ASSERT(results == null);
+ SanityManager.ASSERT(dynamicResults == null);
+ SanityManager.ASSERT(autoGeneratedKeysResultSet == null);
+ }
+
setupContextStack(); // make sure there's context
boolean retval;
pvs = a.getParameterValueSet();
try {
- // The following is from the javadoc for java.sql.Statement
- // Only one ResultSet per Statement can be open at any point in time.
- // Therefore, if the reading of one ResultSet is interleaved with the
- // reading of another, each must have been generated by different Statements.
- // All statement execute methods implicitly close a
- // statment's current ResultSet if an open one exists.
- if (results != null) {
- results.close();
- results = null;
- }
clearWarnings();