summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-11-29 15:09:30 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-29 15:09:30 -0800
commita84a744bb1804d7817093c0ab96d9cbaae3916f0 (patch)
treee61442cd63d61ef5e554ff42a3fb05cb24418484
parent883ad9e260f4da777caf6600ff6bde37fb322003 (diff)
parentb438902369ddb6785963c2bbe3d5d1d8679f7b8f (diff)
downloadframeworks_base-a84a744bb1804d7817093c0ab96d9cbaae3916f0.zip
frameworks_base-a84a744bb1804d7817093c0ab96d9cbaae3916f0.tar.gz
frameworks_base-a84a744bb1804d7817093c0ab96d9cbaae3916f0.tar.bz2
Merge "if db close() fails due to un-closed sql statements, print useful msg"
-rw-r--r--core/java/android/database/sqlite/SQLiteDatabase.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index 7efb7fd..184988b 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -1122,11 +1122,11 @@ public class SQLiteDatabase extends SQLiteClosable {
Map.Entry<SQLiteClosable, Object> entry = iter.next();
SQLiteClosable program = entry.getKey();
if (program != null && program instanceof SQLiteProgram) {
- SQLiteCompiledSql compiledSql = ((SQLiteProgram)program).mCompiledSql;
- if (compiledSql.nStatement == stmtId) {
- msg = compiledSql.toString();
- found = true;
- }
+ SQLiteCompiledSql compiledSql = ((SQLiteProgram)program).mCompiledSql;
+ if (compiledSql.nStatement == stmtId) {
+ msg = compiledSql.toString();
+ found = true;
+ }
}
}
if (!found) {
@@ -1140,8 +1140,9 @@ public class SQLiteDatabase extends SQLiteClosable {
}
} else {
// the statement is not yet closed. most probably programming error in the app.
- Log.w(TAG, "dbclose failed due to un-close()d SQL statements: " + msg);
- throw e;
+ throw new SQLiteUnfinalizedObjectsException(
+ "close() on database: " + getPath() +
+ " failed due to un-close()d SQL statements: " + msg);
}
}
}