Class AbstractControlDAOImpl

  • All Implemented Interfaces:
    ControlDAO
    Direct Known Subclasses:
    ControlDAOImpl

    public abstract class AbstractControlDAOImpl
    extends java.lang.Object
    implements ControlDAO
    Abstract implementation for connection controlling DAO.

    Provides any basic logic.

    Since:
    3.2SP1
    Author:
    Derek Hulley
    • Constructor Detail

      • AbstractControlDAOImpl

        public AbstractControlDAOImpl()
    • Method Detail

      • createSavepoint

        public java.sql.Savepoint createSavepoint​(java.lang.String savepoint)
        Description copied from interface: ControlDAO
        Create a "Save Point" in the current transaction, for later selective rollback. Creation must be accompanied by a matching ControlDAO.rollbackToSavepoint(Savepoint) or ControlDAO.releaseSavepoint(Savepoint).
          Savepoint savepoint = controlDAO.createSavepoint("functionF");
          try
          {
              // Do something that could fail e.g. blind insert that might violate unique constraints
              ...
              // Success, so remove savepoint or risk crashing on long-running transactions
              controlDAO.releaseSavepoint(savepoint);
          }
          catch (Throwable e)
          {
              controlDAO.rollbackToSavepoint(savepoint);
              // Throw something that client code might be able to react to or try something else
              ...
          }
         
        Specified by:
        createSavepoint in interface ControlDAO
        Parameters:
        savepoint - the name of the save point
        Returns:
        Returns null by default i.e. not supported
      • setTransactionIsolationLevel

        public int setTransactionIsolationLevel​(int isolationLevel)
        Description copied from interface: ControlDAO
        Change the current transaction isolation level.

        Note: The isolation level should not - and for some DBs, cannot - be changed except at the very start of the transaction

        Specified by:
        setTransactionIsolationLevel in interface ControlDAO
        Parameters:
        isolationLevel - the transaction isolation level
        Returns:
        Returns the previously-set isolation