Class FHIRTestTransactionAdapter

  • All Implemented Interfaces:
    com.ibm.fhir.persistence.FHIRPersistenceTransaction

    public class FHIRTestTransactionAdapter
    extends Object
    implements com.ibm.fhir.persistence.FHIRPersistenceTransaction
    Hides the logic behind obtaining a JDBC Connection from the DAO code. Use by unit tests or other scenarios where connections are obtained using an IConnectionProvider implementation, outside the scope of a JEE container. Transactions are managed with the help of the SimpleTransactionProvider and wrapped by this class, meaning we have a uniform interface for handling transactions across JEE and unit-test scenarios.
    • Constructor Detail

      • FHIRTestTransactionAdapter

        public FHIRTestTransactionAdapter​(com.ibm.fhir.database.utils.api.IConnectionProvider cp)
        Public constructor
        Parameters:
        cp -
    • Method Detail

      • begin

        public void begin()
                   throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Specified by:
        begin in interface com.ibm.fhir.persistence.FHIRPersistenceTransaction
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • end

        public void end()
                 throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Specified by:
        end in interface com.ibm.fhir.persistence.FHIRPersistenceTransaction
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • setRollbackOnly

        public void setRollbackOnly()
                             throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Specified by:
        setRollbackOnly in interface com.ibm.fhir.persistence.FHIRPersistenceTransaction
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • hasBegun

        public boolean hasBegun()
                         throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Specified by:
        hasBegun in interface com.ibm.fhir.persistence.FHIRPersistenceTransaction
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException