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.
|
ConnectionReleaseMode |
getConnectionReleaseMode()
The release mode under which this logical connection is operating.
|
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.
|
ResourceRegistry |
getResourceRegistry() |
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
|
public JdbcCoordinatorImpl(java.sql.Connection userSuppliedConnection, JdbcSessionOwner owner)
userSuppliedConnection
- The user supplied connection (may be null)public LogicalConnectionImplementor getLogicalConnection()
JdbcCoordinator
getLogicalConnection
in interface JdbcCoordinator
protected SessionFactoryImplementor sessionFactory()
protected BatchBuilder batchBuilder()
public SqlExceptionHelper sqlExceptionHelper()
public void flushBeginning()
JdbcCoordinator
JdbcCoordinator.flushEnding()
flushBeginning
in interface JdbcCoordinator
public void flushEnding()
JdbcCoordinator
flushEnding
in interface JdbcCoordinator
public java.sql.Connection close()
JdbcCoordinator
close
in interface JdbcCoordinator
Connection
associated with the managed logical connection
LogicalConnection.close()
public Batch getBatch(BatchKey key)
JdbcCoordinator
getBatch
in interface JdbcCoordinator
key
- The unique batch key.public void executeBatch()
JdbcCoordinator
executeBatch
in interface JdbcCoordinator
public void abortBatch()
JdbcCoordinator
abortBatch
in interface JdbcCoordinator
public StatementPreparer getStatementPreparer()
JdbcCoordinator
getStatementPreparer
in interface JdbcCoordinator
public ResultSetReturn getResultSetReturn()
JdbcCoordinator
getResultSetReturn
in interface JdbcCoordinator
public void setTransactionTimeOut(int seconds)
TransactionCoordinatorOwner
setTransactionTimeOut
in interface TransactionCoordinatorOwner
seconds
- The number of seconds before a time out should occur.public void flushBeforeTransactionCompletion()
flushBeforeTransactionCompletion
in interface TransactionCoordinatorOwner
public int determineRemainingTransactionTimeOutPeriod()
JdbcCoordinator
determineRemainingTransactionTimeOutPeriod
in interface JdbcCoordinator
public void afterStatementExecution()
JdbcCoordinator
afterStatementExecution
in interface JdbcCoordinator
public void afterTransaction()
JdbcCoordinator
afterTransaction
in interface JdbcCoordinator
public ResourceRegistry getResourceRegistry()
getResourceRegistry
in interface JdbcCoordinator
public ConnectionReleaseMode getConnectionReleaseMode()
JdbcCoordinator
getConnectionReleaseMode
in interface JdbcCoordinator
public <T> T coordinateWork(WorkExecutorVisitable<T> work)
JdbcCoordinator
coordinateWork
in interface JdbcCoordinator
T
- The result type.work
- The work to be performed.public boolean isReadyForSerialization()
JdbcCoordinator
isReadyForSerialization
in interface JdbcCoordinator
true
indicates the coordinator can be serialized.public void registerLastQuery(java.sql.Statement statement)
JdbcCoordinator
registerLastQuery
in interface JdbcCoordinator
statement
- The cancel-able query statement.public void cancelLastQuery()
JdbcCoordinator
cancelLastQuery
in interface JdbcCoordinator
public void enableReleases()
JdbcCoordinator
enableReleases
in interface JdbcCoordinator
public void disableReleases()
JdbcCoordinator
disableReleases
in interface JdbcCoordinator
protected 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()
TransactionCoordinatorOwner
isActive
in interface TransactionCoordinatorOwner
true
indicates the owner is still active; false
indicates it is not.public void afterTransactionBegin()
TransactionCoordinatorOwner
afterTransactionBegin
in interface TransactionCoordinatorOwner
public void beforeTransactionCompletion()
TransactionCoordinatorOwner
beforeTransactionCompletion
in interface TransactionCoordinatorOwner
public void afterTransactionCompletion(boolean successful, boolean delayed)
TransactionCoordinatorOwner
afterTransactionCompletion
in interface TransactionCoordinatorOwner
successful
- Was the transaction successful?delayed
- Is this a delayed after transaction completion call (aka after a timeout)?public JdbcSessionOwner getJdbcSessionOwner()
getJdbcSessionOwner
in interface TransactionCoordinatorOwner
public JdbcResourceTransaction getResourceLocalTransaction()
JdbcResourceTransactionAccess
getResourceLocalTransaction
in interface JdbcResourceTransactionAccess
public void serialize(java.io.ObjectOutputStream oos) throws java.io.IOException
oos
- 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.