Skip to content

Commit eb44da1

Browse files
committed
Fixed attribute hiding and removed database connection close
According to this post by a Google engineer (http://groups.google.com/group/android-developers/msg/74ee967b2fcff770), there's nothing wrong with leaving the database connection open
1 parent b296aad commit eb44da1

File tree

1 file changed

+1
-2
lines changed
  • omniNotes/src/main/java/it/feio/android/omninotes/db

1 file changed

+1
-2
lines changed

omniNotes/src/main/java/it/feio/android/omninotes/db/DbHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
199199

200200

201201
public Note updateNote(Note note, boolean updateLastModification) {
202-
SQLiteDatabase db = getDatabase(true);
202+
db = getDatabase(true);
203203

204204
String content = note.isLocked()
205205
? Security.encrypt(note.getContent(), prefs.getString(Constants.PREF_PASSWORD, ""))
@@ -246,7 +246,6 @@ public Note updateNote(Note note, boolean updateLastModification) {
246246

247247
db.setTransactionSuccessful();
248248
db.endTransaction();
249-
db.close();
250249

251250
// Fill the note with correct data before returning it
252251
note.setCreation(note.getCreation() > 0 ? note.getCreation() : values.getAsLong(KEY_CREATION));

0 commit comments

Comments
 (0)