类 JdbcCoordinatorImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl
-
public class JdbcCoordinatorImpl extends Object implements JdbcCoordinator
Standard Hibernate implementation ofJdbcCoordinatorIMPL NOTE : Custom serialization handling!- 作者:
- Steve Ebersole, Brett Meyer, Sanne Grinovero
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 JdbcCoordinatorImpl(Connection userSuppliedConnection, JdbcSessionOwner owner, JdbcServices jdbcServices)Constructs a JdbcCoordinatorImpl
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 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.voidafterTransactionBegin()A after-begin callback from the coordinator to its owner.voidafterTransactionCompletion(boolean successful, boolean delayed)An after-completion callback from the coordinator to its owner.protected BatchBuilderbatchBuilder()voidbeforeTransactionCompletion()A before-completion callback from the coordinator to its owner.voidcancelLastQuery()Attempt to cancel the last query sent to the JDBC driver.Connectionclose()Close this coordinator and release and resources.protected voidclose(ResultSet resultSet)protected voidclose(Statement statement)<T> TcoordinateWork(WorkExecutorVisitable<T> work)Perform the requested work handling exceptions, coordinating and handling return processing.static JdbcCoordinatorImpldeserialize(ObjectInputStream ois, JdbcSessionOwner owner)JDK deserialization hookintdetermineRemainingTransactionTimeOutPeriod()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)voidflushBeforeTransactionCompletion()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.JdbcSessionOwnergetJdbcSessionOwner()LogicalConnectionImplementorgetLogicalConnection()Retrieves the logical connection associated with this JDBC coordinator.JdbcResourceTransactiongetResourceLocalTransaction()Provides access to the resource local transaction of this data store, which is used by the TransactionCoordinator to manage transactions against the data store when not using JTA.ResultSetReturngetResultSetReturn()Obtain the resultset extractor associated with this JDBC coordinator.StatementPreparergetStatementPreparer()Obtain the statement preparer associated with this JDBC coordinator.booleanisActive()Is the TransactionCoordinator owner considered active?booleanisReadyForSerialization()Can this coordinator be serialized?voidregisterLastQuery(Statement statement)Register a query statement as being able to be cancelled.voidserialize(ObjectOutputStream oos)JDK serialization hookprotected SessionFactoryImplementorsessionFactory()voidsetTransactionTimeOut(int seconds)Set the effective transaction timeout period for the current transaction, in seconds.SqlExceptionHelpersqlExceptionHelper()Access to the SqlExceptionHelper-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.engine.jdbc.spi.JdbcCoordinator
getConnectionHandlingMode, getConnectionReleaseMode, getResourceRegistry
-
从接口继承的方法 org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner
startTransactionBoundary
-
-
-
-
构造器详细资料
-
JdbcCoordinatorImpl
public JdbcCoordinatorImpl(Connection userSuppliedConnection, JdbcSessionOwner owner, JdbcServices jdbcServices)
Constructs a JdbcCoordinatorImpl- 参数:
userSuppliedConnection- The user supplied connection (may be null)
-
-
方法详细资料
-
getLogicalConnection
public LogicalConnectionImplementor getLogicalConnection()
从接口复制的说明:JdbcCoordinatorRetrieves the logical connection associated with this JDBC coordinator.- 指定者:
getLogicalConnection在接口中JdbcCoordinator- 返回:
- The logical connection
-
sessionFactory
protected SessionFactoryImplementor sessionFactory()
-
batchBuilder
protected BatchBuilder batchBuilder()
-
sqlExceptionHelper
public SqlExceptionHelper sqlExceptionHelper()
Access to the SqlExceptionHelper- 返回:
- The SqlExceptionHelper
-
flushBeginning
public void flushBeginning()
从接口复制的说明:JdbcCoordinatorCallback 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 completeJdbcCoordinator.flushEnding()- 指定者:
flushBeginning在接口中JdbcCoordinator
-
flushEnding
public void flushEnding()
从接口复制的说明:JdbcCoordinatorCallback to let us know that a flush is ending. We use this fact to stop circumventing aggressive releasing connections.- 指定者:
flushEnding在接口中JdbcCoordinator
-
close
public Connection close()
从接口复制的说明:JdbcCoordinatorClose this coordinator and release and resources.- 指定者:
close在接口中JdbcCoordinator- 返回:
- The
Connectionassociated with the managedlogical connection - 另请参阅:
LogicalConnection.close()
-
getBatch
public Batch getBatch(BatchKey key)
从接口复制的说明:JdbcCoordinatorGet a batch instance.- 指定者:
getBatch在接口中JdbcCoordinator- 参数:
key- The unique batch key.- 返回:
- The batch
-
executeBatch
public void executeBatch()
从接口复制的说明:JdbcCoordinatorExecute the currently managed batch (if any)- 指定者:
executeBatch在接口中JdbcCoordinator
-
abortBatch
public void abortBatch()
从接口复制的说明:JdbcCoordinatorAbort the currently managed batch (if any)- 指定者:
abortBatch在接口中JdbcCoordinator
-
getStatementPreparer
public StatementPreparer getStatementPreparer()
从接口复制的说明:JdbcCoordinatorObtain the statement preparer associated with this JDBC coordinator.- 指定者:
getStatementPreparer在接口中JdbcCoordinator- 返回:
- This coordinator's statement preparer
-
getResultSetReturn
public ResultSetReturn getResultSetReturn()
从接口复制的说明:JdbcCoordinatorObtain the resultset extractor associated with this JDBC coordinator.- 指定者:
getResultSetReturn在接口中JdbcCoordinator- 返回:
- This coordinator's resultset extractor
-
setTransactionTimeOut
public void setTransactionTimeOut(int seconds)
从接口复制的说明:TransactionCoordinatorOwnerSet the effective transaction timeout period for the current transaction, in seconds.- 指定者:
setTransactionTimeOut在接口中TransactionCoordinatorOwner- 参数:
seconds- The number of seconds before a time out should occur.
-
flushBeforeTransactionCompletion
public void flushBeforeTransactionCompletion()
-
determineRemainingTransactionTimeOutPeriod
public int determineRemainingTransactionTimeOutPeriod()
从接口复制的说明:JdbcCoordinatorCalculate the amount of time, in seconds, still remaining before transaction timeout occurs.- 指定者:
determineRemainingTransactionTimeOutPeriod在接口中JdbcCoordinator- 返回:
- The number of seconds remaining until until a transaction timeout occurs. A negative value indicates no timeout was requested.
-
afterStatementExecution
public void afterStatementExecution()
从接口复制的说明:JdbcCoordinatorUsed 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.- 指定者:
afterStatementExecution在接口中JdbcCoordinator
-
afterTransaction
public void afterTransaction()
从接口复制的说明:JdbcCoordinatorSignals 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.- 指定者:
afterTransaction在接口中JdbcCoordinator
-
coordinateWork
public <T> T coordinateWork(WorkExecutorVisitable<T> work)
从接口复制的说明:JdbcCoordinatorPerform the requested work handling exceptions, coordinating and handling return processing.- 指定者:
coordinateWork在接口中JdbcCoordinator- 类型参数:
T- The result type.- 参数:
work- The work to be performed.- 返回:
- The work result.
-
isReadyForSerialization
public boolean isReadyForSerialization()
从接口复制的说明:JdbcCoordinatorCan this coordinator be serialized?- 指定者:
isReadyForSerialization在接口中JdbcCoordinator- 返回:
trueindicates the coordinator can be serialized.
-
registerLastQuery
public void registerLastQuery(Statement statement)
从接口复制的说明:JdbcCoordinatorRegister a query statement as being able to be cancelled.- 指定者:
registerLastQuery在接口中JdbcCoordinator- 参数:
statement- The cancel-able query statement.
-
cancelLastQuery
public void cancelLastQuery()
从接口复制的说明:JdbcCoordinatorAttempt to cancel the last query sent to the JDBC driver.- 指定者:
cancelLastQuery在接口中JdbcCoordinator
-
enableReleases
public void enableReleases()
从接口复制的说明:JdbcCoordinatorEnable connection releases- 指定者:
enableReleases在接口中JdbcCoordinator
-
disableReleases
public void disableReleases()
从接口复制的说明:JdbcCoordinatorDisable connection releases- 指定者:
disableReleases在接口中JdbcCoordinator
-
close
protected void close(Statement statement)
-
close
protected void close(ResultSet resultSet)
-
isActive
public boolean isActive()
从接口复制的说明:TransactionCoordinatorOwnerIs the TransactionCoordinator owner considered active?- 指定者:
isActive在接口中TransactionCoordinatorOwner- 返回:
trueindicates the owner is still active;falseindicates it is not.
-
afterTransactionBegin
public void afterTransactionBegin()
从接口复制的说明:TransactionCoordinatorOwnerA after-begin callback from the coordinator to its owner.
-
beforeTransactionCompletion
public void beforeTransactionCompletion()
从接口复制的说明:TransactionCoordinatorOwnerA before-completion callback from the coordinator to its owner.
-
afterTransactionCompletion
public void afterTransactionCompletion(boolean successful, boolean delayed)从接口复制的说明:TransactionCoordinatorOwnerAn after-completion callback from the coordinator to its owner.- 指定者:
afterTransactionCompletion在接口中TransactionCoordinatorOwner- 参数:
successful- Was the transaction successful?delayed- Is this delayed after transaction completion call (aka after a timeout)?
-
getJdbcSessionOwner
public JdbcSessionOwner getJdbcSessionOwner()
-
getResourceLocalTransaction
public JdbcResourceTransaction getResourceLocalTransaction()
从接口复制的说明:JdbcResourceTransactionAccessProvides access to the resource local transaction of this data store, which is used by the TransactionCoordinator to manage transactions against the data store when not using JTA.- 指定者:
getResourceLocalTransaction在接口中JdbcResourceTransactionAccess- 返回:
- The resource-local transaction
-
serialize
public void serialize(ObjectOutputStream oos) throws IOException
JDK serialization hook- 指定者:
serialize在接口中JdbcCoordinator- 参数:
oos- The stream into which to write our state- 抛出:
IOException- Trouble accessing the stream
-
deserialize
public static JdbcCoordinatorImpl deserialize(ObjectInputStream ois, JdbcSessionOwner owner) throws IOException, ClassNotFoundException
JDK deserialization hook- 参数:
ois- The stream into which to write our stateowner- The Jdbc Session owner which owns the JdbcCoordinatorImpl to be deserialized.- 返回:
- The deserialized JdbcCoordinatorImpl
- 抛出:
IOException- Trouble accessing the streamClassNotFoundException- Trouble reading the stream
-
-