接口 JdbcCoordinator
-
- 所有已知实现类:
JdbcCoordinatorImpl
public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwner, JdbcResourceTransactionAccess
Coordinates JDBC-related activities.- 作者:
- Steve Ebersole, Brett Meyer
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 已过时的方法 修饰符和类型 方法 说明 voidabortBatch()Abort the currently managed batch (if any)voidafterStatementExecution()Used to signify that a statement has completed execution which may indicate that this logical connection need to perform an aggressive release of its physical connection.voidafterTransaction()Signals the end of transaction.voidcancelLastQuery()Attempt to cancel the last query sent to the JDBC driver.Connectionclose()Close this coordinator and release and resources.<T> TcoordinateWork(WorkExecutorVisitable<T> work)Perform the requested work handling exceptions, coordinating and handling return processing.intdetermineRemainingTransactionTimeOutPeriod()Calculate the amount of time, in seconds, still remaining before transaction timeout occurs.voiddisableReleases()Disable connection releasesvoidenableReleases()Enable connection releasesvoidexecuteBatch()Execute the currently managed batch (if any)voidflushBeginning()Callback to let us know that a flush is beginning.voidflushEnding()Callback to let us know that a flush is ending.BatchgetBatch(BatchKey key)Get a batch instance.default PhysicalConnectionHandlingModegetConnectionHandlingMode()已过时。(since 5.2) access viagetLogicalConnection()insteaddefault ConnectionReleaseModegetConnectionReleaseMode()已过时。(since 5.2) usePhysicalConnectionHandlingModeviagetLogicalConnection()insteadLogicalConnectionImplementorgetLogicalConnection()Retrieves the logical connection associated with this JDBC coordinator.default ResourceRegistrygetResourceRegistry()已过时。(since 5.2) access viagetLogicalConnection()insteadResultSetReturngetResultSetReturn()Obtain the resultset extractor associated with this JDBC coordinator.StatementPreparergetStatementPreparer()Obtain the statement preparer associated with this JDBC coordinator.booleanisReadyForSerialization()Can this coordinator be serialized?voidregisterLastQuery(Statement statement)Register a query statement as being able to be cancelled.voidserialize(ObjectOutputStream objectOutputStream)-
从接口继承的方法 org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess
getResourceLocalTransaction
-
从接口继承的方法 org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, flushBeforeTransactionCompletion, getJdbcSessionOwner, isActive, setTransactionTimeOut, startTransactionBoundary
-
-
-
-
方法详细资料
-
getLogicalConnection
LogicalConnectionImplementor getLogicalConnection()
Retrieves the logical connection associated with this JDBC coordinator.- 返回:
- The logical connection
-
getBatch
Batch getBatch(BatchKey key)
Get a batch instance.- 参数:
key- The unique batch key.- 返回:
- The batch
-
executeBatch
void executeBatch()
Execute the currently managed batch (if any)
-
abortBatch
void abortBatch()
Abort the currently managed batch (if any)
-
getStatementPreparer
StatementPreparer getStatementPreparer()
Obtain the statement preparer associated with this JDBC coordinator.- 返回:
- This coordinator's statement preparer
-
getResultSetReturn
ResultSetReturn getResultSetReturn()
Obtain the resultset extractor associated with this JDBC coordinator.- 返回:
- This coordinator's resultset extractor
-
flushBeginning
void flushBeginning()
Callback to let us know that a flush is beginning. We use this fact to temporarily circumvent aggressive connection releasing until after the flush cycle is completeflushEnding()
-
flushEnding
void flushEnding()
Callback to let us know that a flush is ending. We use this fact to stop circumventing aggressive releasing connections.
-
close
Connection close()
Close this coordinator and release and resources.- 返回:
- The
Connectionassociated with the managedlogical connection - 另请参阅:
LogicalConnection.close()
-
afterTransaction
void afterTransaction()
Signals the end of transaction. Intended for use from the transaction coordinator, after local transaction completion. Used to conditionally release the JDBC connection aggressively if the configured release mode indicates.
-
afterStatementExecution
void afterStatementExecution()
Used to signify that a statement has completed execution which may indicate that this logical connection need to perform an aggressive release of its physical connection.
-
coordinateWork
<T> T coordinateWork(WorkExecutorVisitable<T> work)
Perform the requested work handling exceptions, coordinating and handling return processing.- 类型参数:
T- The result type.- 参数:
work- The work to be performed.- 返回:
- The work result.
-
cancelLastQuery
void cancelLastQuery()
Attempt to cancel the last query sent to the JDBC driver.
-
determineRemainingTransactionTimeOutPeriod
int determineRemainingTransactionTimeOutPeriod()
Calculate the amount of time, in seconds, still remaining before transaction timeout occurs.- 返回:
- The number of seconds remaining until until a transaction timeout occurs. A negative value indicates no timeout was requested.
- 抛出:
TransactionException- Indicates the time out period has already been exceeded.
-
enableReleases
void enableReleases()
Enable connection releases
-
disableReleases
void disableReleases()
Disable connection releases
-
registerLastQuery
void registerLastQuery(Statement statement)
Register a query statement as being able to be cancelled.- 参数:
statement- The cancel-able query statement.
-
isReadyForSerialization
boolean isReadyForSerialization()
Can this coordinator be serialized?- 返回:
trueindicates the coordinator can be serialized.
-
getConnectionReleaseMode
@Deprecated default ConnectionReleaseMode getConnectionReleaseMode()
已过时。(since 5.2) usePhysicalConnectionHandlingModeviagetLogicalConnection()insteadThe release mode under which this logical connection is operating.- 返回:
- the release mode.
-
getConnectionHandlingMode
@Deprecated default PhysicalConnectionHandlingMode getConnectionHandlingMode()
已过时。(since 5.2) access viagetLogicalConnection()insteadThe mode for physical handling of the JDBC Connection- 返回:
- The JDBC Connection handlng mode
-
getResourceRegistry
@Deprecated default ResourceRegistry getResourceRegistry()
已过时。(since 5.2) access viagetLogicalConnection()instead
-
serialize
void serialize(ObjectOutputStream objectOutputStream) throws IOException
- 抛出:
IOException
-
-