public class JdbcCoordinatorImpl extends java.lang.Object implements JdbcCoordinator
JdbcCoordinator
IMPL NOTE : Custom serialization handling!| Constructor and Description |
|---|
JdbcCoordinatorImpl(java.sql.Connection userSuppliedConnection,
JdbcSessionOwner owner)
Constructs a JdbcCoordinatorImpl
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortBatch()
Abort the currently managed batch (if any)
|
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.
|
void |
afterTransaction()
Signals the end of transaction.
|
void |
afterTransactionBegin()
A after-begin callback from the coordinator to its owner.
|
void |
afterTransactionCompletion(boolean successful,
boolean delayed)
An after-completion callback from the coordinator to its owner.
|
protected BatchBuilder |
batchBuilder() |
void |
beforeTransactionCompletion()
A before-completion callback from the coordinator to its owner.
|
void |
cancelLastQuery()
Attempt to cancel the last query sent to the JDBC driver.
|
java.sql.Connection |
close()
Close this coordinator and release and resources.
|
protected void |
close(java.sql.ResultSet resultSet) |
protected void |
close(java.sql.Statement statement) |
protected void |
closeAll(java.util.Set<java.sql.ResultSet> resultSets) |
<T> T |
coordinateWork(WorkExecutorVisitable<T> work)
Perform the requested work handling exceptions, coordinating and handling return processing.
|
static JdbcCoordinatorImpl |
deserialize(java.io.ObjectInputStream ois,
JdbcSessionOwner owner)
JDK deserialization hook
|
int |
determineRemainingTransactionTimeOutPeriod()
Calculate the amount of time, in seconds, still remaining before transaction timeout occurs.
|
void |
disableReleases()
Disable connection releases
|
void |
enableReleases()
Enable connection releases
|
void |
executeBatch()
Execute the currently managed batch (if any)
|
void |
flushBeforeTransactionCompletion() |
void |
flushBeginning()
Callback to let us know that a flush is beginning.
|
void |
flushEnding()
Callback to let us know that a flush is ending.
|
Batch |
getBatch(BatchKey key)
Get a batch instance.
|
JdbcSessionOwner |
getJdbcSessionOwner() |
LogicalConnectionImplementor |
getLogicalConnection()
Retrieves the logical connection associated with this JDBC coordinator.
|
JdbcResourceTransaction |
getResourceLocalTransaction()
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.
|
ResultSetReturn |
getResultSetReturn()
Obtain the resultset extractor associated with this JDBC coordinator.
|
StatementPreparer |
getStatementPreparer()
Obtain the statement preparer associated with this JDBC coordinator.
|
boolean |
isActive()
Is the TransactionCoordinator owner considered active?
|
boolean |
isReadyForSerialization()
Can this coordinator be serialized?
|
void |
registerLastQuery(java.sql.Statement statement)
Register a query statement as being able to be cancelled.
|
void |
serialize(java.io.ObjectOutputStream oos)
JDK serialization hook
|
protected SessionFactoryImplementor |
sessionFactory() |
void |
setTransactionTimeOut(int seconds)
Set the effective transaction timeout period for the current transaction, in seconds.
|
SqlExceptionHelper |
sqlExceptionHelper()
Access to the SqlExceptionHelper
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConnectionHandlingMode, getConnectionReleaseMode, getResourceRegistrypublic JdbcCoordinatorImpl(java.sql.Connection userSuppliedConnection,
JdbcSessionOwner owner)
userSuppliedConnection - The user supplied connection (may be null)public LogicalConnectionImplementor getLogicalConnection()
JdbcCoordinatorgetLogicalConnection in interface JdbcCoordinatorprotected SessionFactoryImplementor sessionFactory()
protected BatchBuilder batchBuilder()
public SqlExceptionHelper sqlExceptionHelper()
public void flushBeginning()
JdbcCoordinatorJdbcCoordinator.flushEnding()flushBeginning in interface JdbcCoordinatorpublic void flushEnding()
JdbcCoordinatorflushEnding in interface JdbcCoordinatorpublic java.sql.Connection close()
JdbcCoordinatorclose in interface JdbcCoordinatorConnection associated with the managed logical connectionLogicalConnection.close()public Batch getBatch(BatchKey key)
JdbcCoordinatorgetBatch in interface JdbcCoordinatorkey - The unique batch key.public void executeBatch()
JdbcCoordinatorexecuteBatch in interface JdbcCoordinatorpublic void abortBatch()
JdbcCoordinatorabortBatch in interface JdbcCoordinatorpublic StatementPreparer getStatementPreparer()
JdbcCoordinatorgetStatementPreparer in interface JdbcCoordinatorpublic ResultSetReturn getResultSetReturn()
JdbcCoordinatorgetResultSetReturn in interface JdbcCoordinatorpublic void setTransactionTimeOut(int seconds)
TransactionCoordinatorOwnersetTransactionTimeOut in interface TransactionCoordinatorOwnerseconds - The number of seconds before a time out should occur.public void flushBeforeTransactionCompletion()
flushBeforeTransactionCompletion in interface TransactionCoordinatorOwnerpublic int determineRemainingTransactionTimeOutPeriod()
JdbcCoordinatordetermineRemainingTransactionTimeOutPeriod in interface JdbcCoordinatorpublic void afterStatementExecution()
JdbcCoordinatorafterStatementExecution in interface JdbcCoordinatorpublic void afterTransaction()
JdbcCoordinatorafterTransaction in interface JdbcCoordinatorpublic <T> T coordinateWork(WorkExecutorVisitable<T> work)
JdbcCoordinatorcoordinateWork in interface JdbcCoordinatorT - The result type.work - The work to be performed.public boolean isReadyForSerialization()
JdbcCoordinatorisReadyForSerialization in interface JdbcCoordinatortrue indicates the coordinator can be serialized.public void registerLastQuery(java.sql.Statement statement)
JdbcCoordinatorregisterLastQuery in interface JdbcCoordinatorstatement - The cancel-able query statement.public void cancelLastQuery()
JdbcCoordinatorcancelLastQuery in interface JdbcCoordinatorpublic void enableReleases()
JdbcCoordinatorenableReleases in interface JdbcCoordinatorpublic void disableReleases()
JdbcCoordinatordisableReleases in interface JdbcCoordinatorprotected void closeAll(java.util.Set<java.sql.ResultSet> resultSets)
protected void close(java.sql.Statement statement)
protected void close(java.sql.ResultSet resultSet)
public boolean isActive()
TransactionCoordinatorOwnerisActive in interface TransactionCoordinatorOwnertrue indicates the owner is still active; false indicates it is not.public void afterTransactionBegin()
TransactionCoordinatorOwnerafterTransactionBegin in interface TransactionCoordinatorOwnerpublic void beforeTransactionCompletion()
TransactionCoordinatorOwnerbeforeTransactionCompletion in interface TransactionCoordinatorOwnerpublic void afterTransactionCompletion(boolean successful,
boolean delayed)
TransactionCoordinatorOwnerafterTransactionCompletion in interface TransactionCoordinatorOwnersuccessful - Was the transaction successful?delayed - Is this a delayed after transaction completion call (aka after a timeout)?public JdbcSessionOwner getJdbcSessionOwner()
getJdbcSessionOwner in interface TransactionCoordinatorOwnerpublic JdbcResourceTransaction getResourceLocalTransaction()
JdbcResourceTransactionAccessgetResourceLocalTransaction in interface JdbcResourceTransactionAccesspublic void serialize(java.io.ObjectOutputStream oos)
throws java.io.IOException
serialize in interface JdbcCoordinatoroos - The stream into which to write our statejava.io.IOException - Trouble accessing the streampublic static JdbcCoordinatorImpl deserialize(java.io.ObjectInputStream ois, JdbcSessionOwner owner) throws java.io.IOException, java.lang.ClassNotFoundException
ois - The stream into which to write our stateowner - The Jdbc Session owner which owns the JdbcCoordinatorImpl to be deserialized.java.io.IOException - Trouble accessing the streamjava.lang.ClassNotFoundException - Trouble reading the streamCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.