public interface LocalRepoTransaction extends AutoCloseable, DaoProvider, ExtensibleContext
| Modifier and Type | Method and Description |
|---|---|
void |
addPostCloseListener(LocalRepoTransactionPostCloseListener listener) |
void |
addPreCloseListener(LocalRepoTransactionPreCloseListener listener) |
void |
close()
Equivalent to
rollbackIfActive(). |
void |
commit() |
void |
flush() |
LocalRepoManager |
getLocalRepoManager() |
long |
getLocalRevision() |
boolean |
isActive() |
void |
rollback() |
void |
rollbackIfActive() |
getDaogetContextObject, removeContextObject, removeContextObject, setContextObjectvoid commit()
boolean isActive()
void rollback()
void rollbackIfActive()
void close()
rollbackIfActive().
Implementations must make sure that invoking close() means exactly the same as invoking
rollbackIfActive(). This method was added to make the usage of LocalRepoTransaction
possible in a try-with-resources-clause. See AutoCloseable for more details. Here's a code
example:
try ( LocalRepoTransaction transaction = localRepoManager.beginWriteTransaction(); ) {
// Write sth. into the database...
// And don't forget to commit!
transaction.commit();
}
close in interface AutoCloseablerollbackIfActive()long getLocalRevision()
LocalRepoManager getLocalRepoManager()
void flush()
void addPreCloseListener(LocalRepoTransactionPreCloseListener listener)
void addPostCloseListener(LocalRepoTransactionPostCloseListener listener)
Copyright © 2013–2017. All rights reserved.