diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/org/connectbot/util/HostDatabase.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/src/main/java/org/connectbot/util/HostDatabase.java b/app/src/main/java/org/connectbot/util/HostDatabase.java index 7c59807..9bf08dc 100644 --- a/app/src/main/java/org/connectbot/util/HostDatabase.java +++ b/app/src/main/java/org/connectbot/util/HostDatabase.java @@ -533,9 +533,15 @@ public class HostDatabase extends RobustSQLiteOpenHelper implements HostStorage, values.put(FIELD_HOST_HOSTKEYALGO, hostkeyalgo); values.put(FIELD_HOST_HOSTKEY, hostkey); - mDb.update(TABLE_HOSTS, values, - FIELD_HOST_HOSTNAME + " = ? AND " + FIELD_HOST_PORT + " = ?", - new String[] {hostname, String.valueOf(port)}); + mDb.beginTransaction(); + try { + mDb.update(TABLE_HOSTS, values, + FIELD_HOST_HOSTNAME + " = ? AND " + FIELD_HOST_PORT + " = ?", + new String[]{hostname, String.valueOf(port)}); + mDb.setTransactionSuccessful(); + } finally { + mDb.endTransaction(); + } Log.d(TAG, String.format("Finished saving hostkey information for '%s'", hostname)); } |