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() |
getDao
getContextObject, removeContextObject, removeContextObject, setContextObject
void 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 AutoCloseable
rollbackIfActive()
long getLocalRevision()
LocalRepoManager getLocalRepoManager()
void flush()
void addPreCloseListener(LocalRepoTransactionPreCloseListener listener)
void addPostCloseListener(LocalRepoTransactionPostCloseListener listener)
Copyright © 2013–2019. All rights reserved.