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 ka...@apache.org on 2013/08/28 12:41:33 UTC
svn commit: r1518150 - in /db/derby/code/branches/10.10: ./
java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
Author: kahatlen
Date: Wed Aug 28 10:41:32 2013
New Revision: 1518150
URL: http://svn.apache.org/r1518150
Log:
DERBY-6297: Intermittent failures in XplainStatisticsTest.testSimpleXplainOnly
Merged revision 1518111 from trunk.
Modified:
db/derby/code/branches/10.10/ (props changed)
db/derby/code/branches/10.10/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
Propchange: db/derby/code/branches/10.10/
------------------------------------------------------------------------------
Merged /db/derby/code/trunk:r1518111
Modified: db/derby/code/branches/10.10/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java?rev=1518150&r1=1518149&r2=1518150&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java (original)
+++ db/derby/code/branches/10.10/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java Wed Aug 28 10:41:32 2013
@@ -144,15 +144,20 @@ public class AccessDatabase {
* name that was passed in to this instance.
*/
private boolean schemaExists() throws SQLException {
- boolean found=false;
ResultSet result = conn.getMetaData().getSchemas();
- while(result.next()){
- if(result.getString(1).equals(schema)){
- found=true;
- break;
- }
- }
- return found;
+ try {
+ while (result.next()) {
+ if (result.getString(1).equals(schema)) {
+ // Found it!
+ return true;
+ }
+ }
+ } finally {
+ result.close();
+ }
+
+ // Didn't find the schema.
+ return false;
}
public boolean verifySchemaExistance() {