hpqtypes-1.6.0.0: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Transaction.Settings

Synopsis

Documentation

data RestartPredicate Source #

Predicate that determines whether the transaction has to be restarted.

Constructors

Exception e => RestartPredicate (e -> Integer -> Bool) 

data TransactionSettings Source #

Constructors

TransactionSettings 

Fields

  • tsAutoTransaction :: !Bool

    If set to True, transaction will be automatically started at the beginning of database action and after each commit / rollback. If set to False, no transaction will automatically start in either of above cases.

  • tsIsolationLevel :: !IsolationLevel

    Isolation level of all transactions.

  • tsRestartPredicate :: !(Maybe RestartPredicate)

    Defines behavior of withTransaction in case exceptions thrown within supplied monadic action are not caught and reach its body. If set to Nothing, exceptions will be propagated as usual. If set to Just f, exceptions will be intercepted and passed to f along with a number that indicates how many times the transaction block already failed. If f returns True, the transaction is restarted. Otherwise the exception is further propagated. This allows for restarting transactions e.g. in case of serialization failure. It is up to the caller to ensure that is it safe to execute supplied monadic action multiple times.

  • tsPermissions :: !Permissions

    Permissions of all transactions.

def :: Default a => a #

The default value for this type.