summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/IsolationLevel.java
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2006-10-02 06:08:44 +0000
committerBrian S. O'Neill <bronee@gmail.com>2006-10-02 06:08:44 +0000
commitfb3696bc72ce7bcbf17a5188b7fec1c5b690ad23 (patch)
treef71aec688dd3be3188ee179c7bfdac5668c3758e /src/main/java/com/amazon/carbonado/IsolationLevel.java
parent83dc6080af2a6e00e6aa383af5fe6d3382eea43c (diff)
Add support SNAPSHOT isolation level.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/IsolationLevel.java')
-rw-r--r--src/main/java/com/amazon/carbonado/IsolationLevel.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/IsolationLevel.java b/src/main/java/com/amazon/carbonado/IsolationLevel.java
index 5f963b2..7571205 100644
--- a/src/main/java/com/amazon/carbonado/IsolationLevel.java
+++ b/src/main/java/com/amazon/carbonado/IsolationLevel.java
@@ -26,6 +26,7 @@ package com.amazon.carbonado;
* <li>{@link #READ_UNCOMMITTED}
* <li>{@link #READ_COMMITTED}
* <li>{@link #REPEATABLE_READ}
+ * <li>{@link #SNAPSHOT}
* <li>{@link #SERIALIZABLE}
* </ul>
*
@@ -35,6 +36,11 @@ package com.amazon.carbonado;
* iteration. It releases locks during iteration rather than holding on to them
* until the transaction exits.
*
+ * <p>{@code SNAPSHOT} isolation is special in that it uses multiversion
+ * concurrency control (MVCC). A commit may fail with an {@link
+ * OptimisticLockException}. Few repositories are expected to support this
+ * level, however.
+ *
* @author Brian S O'Neill
* @see Repository#enterTransaction(IsolationLevel)
* @see Transaction
@@ -73,6 +79,13 @@ public enum IsolationLevel {
/**
* Indicates that dirty reads, non-repeatable reads and phantom reads are
+ * prevented. Commits can still fail however, as snapshot isolation avoids
+ * using locks.
+ */
+ SNAPSHOT,
+
+ /**
+ * Indicates that dirty reads, non-repeatable reads and phantom reads are
* prevented. Phantoms are records returned as a result of a search, but
* which were not seen by the same transaction when the identical search
* criteria was previously used. For example, another transaction may have