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 protected
SimpleTransaction(IConnectionProvider cp)
Protected constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Override theAutoCloseable.close()
method so that we can refine the exceptionvoid
setRollbackOnly()
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 DataAccessException
Description copied from interface:ITransaction
Override theAutoCloseable.close()
method so that we can refine the exception- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceITransaction
- Throws:
DataAccessException
-
setRollbackOnly
public void setRollbackOnly()
Description copied from interface:ITransaction
Mark the transaction as failed, so that we we end it, we'll rollback- Specified by:
setRollbackOnly
in interfaceITransaction
-
-