reduce java locking on SQLiteDatabase if sql is already compiled

Change-Id: I6c2c593ba69aad201cedf097384d0b5d835c0839
This commit is contained in:
Vasu Nori
2010-07-08 12:51:50 -07:00
parent 818505aa30
commit b2d2ddc5ac

View File

@ -76,11 +76,6 @@ public abstract class SQLiteProgram extends SQLiteClosable {
}
private void compileSql() {
if (nStatement > 0) {
// already compiled.
return;
}
// only cache CRUD statements
if (getSqlStatementType(mSql) == OTHER_STMT) {
mCompiledSql = new SQLiteCompiledSql(mDatabase, mSql);
@ -165,6 +160,10 @@ public abstract class SQLiteProgram extends SQLiteClosable {
attachObjectToDatabase(db);
}
// compile the sql statement
if (nStatement > 0) {
// already compiled.
return;
}
mDatabase.lock();
try {
compileSql();