Use a lock to ensure transaction isolation. #272

This commit is contained in:
akwizgran
2016-03-24 17:18:54 +00:00
parent 9714713d73
commit 1855dbbd2d
22 changed files with 248 additions and 189 deletions

View File

@@ -37,7 +37,7 @@ class IdentityManagerImpl implements IdentityManager {
@Override
public void addLocalAuthor(LocalAuthor localAuthor) throws DbException {
Transaction txn = db.startTransaction();
Transaction txn = db.startTransaction(false);
try {
db.addLocalAuthor(txn, localAuthor);
for (AddIdentityHook hook : addHooks)
@@ -51,7 +51,7 @@ class IdentityManagerImpl implements IdentityManager {
@Override
public LocalAuthor getLocalAuthor(AuthorId a) throws DbException {
LocalAuthor author;
Transaction txn = db.startTransaction();
Transaction txn = db.startTransaction(true);
try {
author = db.getLocalAuthor(txn, a);
txn.setComplete();
@@ -64,7 +64,7 @@ class IdentityManagerImpl implements IdentityManager {
@Override
public Collection<LocalAuthor> getLocalAuthors() throws DbException {
Collection<LocalAuthor> authors;
Transaction txn = db.startTransaction();
Transaction txn = db.startTransaction(true);
try {
authors = db.getLocalAuthors(txn);
txn.setComplete();
@@ -76,7 +76,7 @@ class IdentityManagerImpl implements IdentityManager {
@Override
public void removeLocalAuthor(AuthorId a) throws DbException {
Transaction txn = db.startTransaction();
Transaction txn = db.startTransaction(false);
try {
LocalAuthor localAuthor = db.getLocalAuthor(txn, a);
for (RemoveIdentityHook hook : removeHooks)