public class TransactionManagerImpl extends Object implements TransactionManager
Constructor and Description |
---|
TransactionManagerImpl() |
Modifier and Type | Method and Description |
---|---|
TorqueConnection |
begin()
Begin a transaction by retrieving a connection from the default database
connection pool.
|
TorqueConnection |
begin(String dbName)
Begin a transaction by retrieving a connection from the named database
connection pool.
|
void |
commit(Connection con)
Commit a transaction and close the connection.
|
void |
rollback(Connection con)
Roll back a transaction and release the connection.
|
void |
safeRollback(Connection con)
Roll back a transaction without throwing errors if they occur.
|
public TorqueConnection begin() throws TorqueException
begin
in interface TransactionManager
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public TorqueConnection begin(String dbName) throws TorqueException
begin
in interface TransactionManager
dbName
- Name of database.TorqueException
- If the connection cannot be retrieved.public void commit(Connection con) throws TorqueException
commit
in interface TransactionManager
con
- The Connection for the transaction.TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public void rollback(Connection con) throws TorqueException
rollback
in interface TransactionManager
con
- The Connection for the transaction.TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public void safeRollback(Connection con)
safeRollback
in interface TransactionManager
con
- The Connection for the transaction.rollback(Connection)
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.