org.helidb.txn
Interface TransactionalDatabase<K,V>
- Type Parameters:
K
- The type of keys in the database.V
- The type of values in the database.
- All Superinterfaces:
- Database<K,V>, Iterable<Record<K,V>>, Map<K,V>
- All Known Implementing Classes:
- AbstractTransactionalDatabase, LoggingTransactionalDatabase, ShadowCopyTransactionalDatabase
public interface TransactionalDatabase<K,V>
- extends Database<K,V>
This interface extends the Database
interface with a method for
joining a transaction manually.
Transactional databases should never store their data in
FileSystem
:s that are locking since the transactional
database has its own set of locks to protect its data.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- See Also:
Transaction
- In_jar:
- helidb-core
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Method Summary |
void |
joinTransaction(boolean readOnly)
Manually join the calling thread's transaction. |
Methods inherited from interface org.helidb.Database |
close, compact, delete, fasterInsert, find, find, find, firstRecord, insert, insertOrUpdate, isClosed, keyIterator, lastRecord, update, valueIterator |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
joinTransaction
void joinTransaction(boolean readOnly)
throws NoTransactionException,
ReadOnlyTransactionException
- Manually join the calling thread's transaction. If this is not called,
the calling thread's transaction is joined automatically when the thread
reads from or writes to the database.
- Parameters:
readOnly
- Should this database join the transaction as read only?
- Throws:
NoTransactionException
- If the current thread does not have a
transaction.
ReadOnlyTransactionException
- If the current transaction is read
only but the calling thread is trying to join it read/write.