Class SimpleTransaction
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.transaction.SimpleTransaction
-
- All Implemented Interfaces:
java.lang.AutoCloseable,ITransaction
public final class SimpleTransaction extends java.lang.Object implements ITransaction
Simple implementation of a transaction service, taking cues from JEE but without the overhead. No distributed transaction support.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleTransaction(IConnectionProvider cp)Protected constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Override theAutoCloseable.close()method so that we can refine the exceptionvoidsetRollbackOnly()Mark the transaction as failed, so that we we end it, we'll rollback
-
-
-
Constructor Detail
-
SimpleTransaction
protected SimpleTransaction(IConnectionProvider cp)
Protected constructor. Should only be instantiated by the TransactionFactory- Parameters:
cp-
-
-
Method Detail
-
close
public void close() throws DataAccessExceptionDescription copied from interface:ITransactionOverride theAutoCloseable.close()method so that we can refine the exception- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceITransaction- Throws:
DataAccessException
-
setRollbackOnly
public void setRollbackOnly()
Description copied from interface:ITransactionMark the transaction as failed, so that we we end it, we'll rollback- Specified by:
setRollbackOnlyin interfaceITransaction
-
-