diff --git a/bramble-api/src/main/java/org/briarproject/bramble/api/properties/TransportPropertyManager.java b/bramble-api/src/main/java/org/briarproject/bramble/api/properties/TransportPropertyManager.java index a29698873c3f016e6a19bcb436cc641a287b4969..8a219c0c69e047878b7e6b4be70c709c5e3ae965 100644 --- a/bramble-api/src/main/java/org/briarproject/bramble/api/properties/TransportPropertyManager.java +++ b/bramble-api/src/main/java/org/briarproject/bramble/api/properties/TransportPropertyManager.java @@ -33,7 +33,7 @@ public interface TransportPropertyManager { /** * Returns the local transport properties for all transports. * <br/> - * Read-Only + * TODO: Transaction can be read-only when code is simplified */ Map<TransportId, TransportProperties> getLocalProperties(Transaction txn) throws DbException; diff --git a/bramble-core/src/main/java/org/briarproject/bramble/properties/TransportPropertyManagerImpl.java b/bramble-core/src/main/java/org/briarproject/bramble/properties/TransportPropertyManagerImpl.java index cdd4d57abda90c72f4385615073330a59702366a..0aa1c7e9f8313c39d96809b8fc0a84b3fe08520a 100644 --- a/bramble-core/src/main/java/org/briarproject/bramble/properties/TransportPropertyManagerImpl.java +++ b/bramble-core/src/main/java/org/briarproject/bramble/properties/TransportPropertyManagerImpl.java @@ -129,7 +129,8 @@ class TransportPropertyManagerImpl implements TransportPropertyManager, public Map<TransportId, TransportProperties> getLocalProperties() throws DbException { Map<TransportId, TransportProperties> local; - Transaction txn = db.startTransaction(true); + // TODO: Transaction can be read-only when code is simplified + Transaction txn = db.startTransaction(false); try { local = getLocalProperties(txn); db.commitTransaction(txn); @@ -165,7 +166,8 @@ class TransportPropertyManagerImpl implements TransportPropertyManager, throws DbException { try { TransportProperties p = null; - Transaction txn = db.startTransaction(true); + // TODO: Transaction can be read-only when code is simplified + Transaction txn = db.startTransaction(false); try { // Find the latest local update LatestUpdate latest = findLatest(txn, localGroup.getId(), t, @@ -192,7 +194,8 @@ class TransportPropertyManagerImpl implements TransportPropertyManager, TransportId t) throws DbException { Map<ContactId, TransportProperties> remote = new HashMap<ContactId, TransportProperties>(); - Transaction txn = db.startTransaction(true); + // TODO: Transaction can be read-only when code is simplified + Transaction txn = db.startTransaction(false); try { for (Contact c : db.getContacts(txn)) remote.put(c.getId(), getRemoteProperties(txn, c, t)); @@ -226,7 +229,8 @@ class TransportPropertyManagerImpl implements TransportPropertyManager, public TransportProperties getRemoteProperties(ContactId c, TransportId t) throws DbException { TransportProperties p; - Transaction txn = db.startTransaction(true); + // TODO: Transaction can be read-only when code is simplified + Transaction txn = db.startTransaction(false); try { p = getRemoteProperties(txn, db.getContact(txn, c), t); db.commitTransaction(txn);