public class JdbcCoordinatorImpl extends Object implements JdbcCoordinator
JdbcCoordinator
 
 IMPL NOTE : Custom serialization handling!| Constructor and Description | 
|---|
JdbcCoordinatorImpl(Connection userSuppliedConnection,
                   TransactionCoordinator transactionCoordinator)
Constructs a JdbcCoordinatorImpl 
 | 
JdbcCoordinatorImpl(LogicalConnectionImpl logicalConnection,
                   TransactionCoordinator transactionCoordinator)
Constructs a JdbcCoordinatorImpl 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
abortBatch()
Abort the currently managed batch (if any) 
 | 
void | 
afterDeserialize(TransactionCoordinatorImpl transactionCoordinator)
Callback after deserialization from Session is done 
 | 
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. 
 | 
protected BatchBuilder | 
batchBuilder()  | 
void | 
cancelLastQuery()
Attempt to cancel the last query sent to the JDBC driver. 
 | 
Connection | 
close()
Close this coordinator and release and resources. 
 | 
protected void | 
close(ResultSet resultSet)  | 
protected void | 
close(Statement statement)  | 
protected void | 
closeAll(Set<ResultSet> resultSets)  | 
<T> T | 
coordinateWork(WorkExecutorVisitable<T> work)
Perform the requested work handling exceptions, coordinating and handling return processing. 
 | 
static JdbcCoordinatorImpl | 
deserialize(ObjectInputStream ois,
           TransactionContext transactionContext)
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 | 
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. 
 | 
LogicalConnectionImplementor | 
getLogicalConnection()
Retrieves the logical connection associated with this JDBC coordinator. 
 | 
ResultSetReturn | 
getResultSetReturn()
Obtain the resultset extractor associated with this JDBC coordinator. 
 | 
StatementPreparer | 
getStatementPreparer()
Obtain the statement preparer associated with this JDBC coordinator. 
 | 
TransactionCoordinator | 
getTransactionCoordinator()
Retrieve the transaction coordinator associated with this JDBC coordinator. 
 | 
boolean | 
hasRegisteredResources()
Does this registry currently have any registered resources? 
 | 
boolean | 
isReadyForSerialization()
Can this coordinator be serialized? 
 | 
void | 
register(ResultSet resultSet,
        Statement statement)
Register a JDBC result set. 
 | 
void | 
register(Statement statement)
Register a JDBC statement. 
 | 
void | 
registerLastQuery(Statement statement)
Register a query statement as being able to be cancelled. 
 | 
void | 
release(ResultSet resultSet,
       Statement statement)
Release a previously registered result set. 
 | 
void | 
release(Statement statement)
Release a previously registered statement. 
 | 
void | 
releaseResources()
Release all registered resources. 
 | 
void | 
serialize(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 
 | 
protected TransactionEnvironment | 
transactionEnvironment()  | 
public JdbcCoordinatorImpl(Connection userSuppliedConnection, TransactionCoordinator transactionCoordinator)
userSuppliedConnection - The user supplied connection (may be null)transactionCoordinator - The transaction coordinatorpublic JdbcCoordinatorImpl(LogicalConnectionImpl logicalConnection, TransactionCoordinator transactionCoordinator)
logicalConnection - The logical JDBC connectiontransactionCoordinator - The transaction coordinatorpublic TransactionCoordinator getTransactionCoordinator()
JdbcCoordinatorgetTransactionCoordinator in interface JdbcCoordinatorpublic LogicalConnectionImplementor getLogicalConnection()
JdbcCoordinatorgetLogicalConnection in interface JdbcCoordinatorprotected TransactionEnvironment transactionEnvironment()
protected SessionFactoryImplementor sessionFactory()
protected BatchBuilder batchBuilder()
public SqlExceptionHelper sqlExceptionHelper()
public void flushBeginning()
JdbcCoordinatorJdbcCoordinator.flushEnding()flushBeginning in interface JdbcCoordinatorpublic void flushEnding()
JdbcCoordinatorflushEnding in interface JdbcCoordinatorpublic 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)
JdbcCoordinatorsetTransactionTimeOut in interface JdbcCoordinatorseconds - The number of seconds before a time out should occur.public 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 serialize(ObjectOutputStream oos) throws IOException
oos - The stream into which to write our stateIOException - Trouble accessing the streampublic static JdbcCoordinatorImpl deserialize(ObjectInputStream ois, TransactionContext transactionContext) throws IOException, ClassNotFoundException
ois - The stream into which to write our statetransactionContext - The transaction context which owns the JdbcCoordinatorImpl to be deserialized.IOException - Trouble accessing the streamClassNotFoundException - Trouble reading the streampublic void afterDeserialize(TransactionCoordinatorImpl transactionCoordinator)
transactionCoordinator - The transaction coordinatorpublic void register(Statement statement)
JdbcCoordinatorregister in interface JdbcCoordinatorstatement - The statement to register.public void registerLastQuery(Statement statement)
JdbcCoordinatorregisterLastQuery in interface JdbcCoordinatorstatement - The cancel-able query statement.public void cancelLastQuery()
JdbcCoordinatorcancelLastQuery in interface JdbcCoordinatorpublic void release(Statement statement)
JdbcCoordinatorrelease in interface JdbcCoordinatorstatement - The statement to release.public void register(ResultSet resultSet, Statement statement)
JdbcCoordinatorResultSet.getStatement()
 does not return original Statement object.register in interface JdbcCoordinatorresultSet - The result set to register.statement - Statement from which ResultSet has been generated.public void release(ResultSet resultSet, Statement statement)
JdbcCoordinatorrelease in interface JdbcCoordinatorresultSet - The result set to release.statement - Statement from which ResultSet has been generated.public boolean hasRegisteredResources()
JdbcCoordinatorhasRegisteredResources in interface JdbcCoordinatorpublic void releaseResources()
JdbcCoordinatorreleaseResources in interface JdbcCoordinatorpublic void enableReleases()
JdbcCoordinatorenableReleases in interface JdbcCoordinatorpublic void disableReleases()
JdbcCoordinatordisableReleases in interface JdbcCoordinatorprotected void close(Statement statement)
protected void close(ResultSet resultSet)
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.