public interface ShardingSphereTransactionManager extends AutoCloseable
| 限定符和类型 | 方法和说明 |
|---|---|
void |
begin()
Begin transaction.
|
void |
begin(int timeout)
Begin transaction with given timeout.
|
void |
commit(boolean rollbackOnly)
Commit transaction.
|
Connection |
getConnection(String databaseName,
String dataSourceName)
Get transactional connection.
|
TransactionType |
getTransactionType()
Get transaction type.
|
void |
init(org.apache.shardingsphere.infra.database.type.DatabaseType databaseType,
Collection<ResourceDataSource> resourceDataSources,
String providerType)
Initialize transaction manager.
|
boolean |
isInTransaction()
Judge is in transaction or not.
|
void |
rollback()
Rollback transaction.
|
closevoid init(org.apache.shardingsphere.infra.database.type.DatabaseType databaseType,
Collection<ResourceDataSource> resourceDataSources,
String providerType)
databaseType - database typeresourceDataSources - resource data sourcesproviderType - transaction manager provider typeTransactionType getTransactionType()
boolean isInTransaction()
Connection getConnection(String databaseName, String dataSourceName) throws SQLException
databaseName - database namedataSourceName - data source nameSQLException - SQL exceptionvoid begin()
void begin(int timeout)
timeout - Transaction timeout in SECONDSvoid commit(boolean rollbackOnly)
rollbackOnly - rollback onlyvoid rollback()
Copyright © 2022 The Apache Software Foundation. All rights reserved.