definition: |
runT :: Transaction a -> IO (Either a TError) runT trans = do beginTransaction result <- catchTrans $ unTrans trans case result of Error err -> do rollbackTransaction return (Right err) OK res -> do commitTransaction return (Left res) |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
documentation: |
--- Runs a transaction atomically in the IO monad. --- --- Transactions are <em>immediate</em>, which means that locks are --- acquired on all databases as soon as the transaction is --- started. After one transaction is started, no other database --- connection will be able to write to the database or start a --- transaction. Other connections <em>can</em> read the database --- during a transaction of another process. --- --- The choice to use immediate rather than deferred transactions is --- conservative. It might also be possible to allow multiple --- simultaneous transactions that lock tables on the first database --- access (which is the default in SQLite). However this leads to --- unpredictable order in which locks are taken when multiple --- databases are involved. The current implementation fixes the --- locking order by sorting databases by their name and locking them --- in order immediately when a transaction begins. --- --- More information on --- <a href="http://sqlite.org/lang_transaction.html">transactions</a> --- in SQLite is available online. --- |
failfree: |
_ |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_) |-> _} |
name: |
runT |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
Transaction a -> Prelude.IO (Prelude.Either a TError) |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
reducible on all ground data terms |