diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java | 6 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java index 0e2ed96..45fe85c 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java @@ -22,6 +22,7 @@ import java.io.File; import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.commons.logging.Log;
@@ -440,6 +441,11 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> abstract Txn txn_begin(Txn parent, IsolationLevel level) throws Exception;
+ // Subclass should override this method to actually apply the timeout
+ Txn txn_begin(Txn parent, IsolationLevel level, int timeout, TimeUnit unit) throws Exception {
+ return txn_begin(parent, level);
+ }
+
abstract Txn txn_begin_nowait(Txn parent, IsolationLevel level) throws Exception;
abstract void txn_commit(Txn txn) throws Exception;
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java index 53ca5e4..58a9e8d 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java @@ -65,7 +65,7 @@ class BDBTransactionManager<Txn> extends TransactionManager<Txn> { if (timeout == 0) {
return repository().txn_begin_nowait(parent, level);
} else {
- return repository().txn_begin(parent, level);
+ return repository().txn_begin(parent, level, timeout, unit);
}
}
|