Top Description Methods
org.hibernate.engine.jdbc.spi

public Interface JdbcCoordinator

extends Serializable, TransactionCoordinatorOwner, JdbcResourceTransactionAccess
Known Direct Implementers
org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl
Imports
java.io.IOException, .ObjectOutputStream, .Serializable, java.sql.Connection, .Statement, org.hibernate.ConnectionReleaseMode, org.hibernate.engine.jdbc.batch.spi.Batch, .BatchKey, org.hibernate.jdbc.WorkExecutorVisitable, org.hibernate.resource.jdbc.ResourceRegistry, org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor, .PhysicalConnectionHandlingMode, org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess, org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner

Coordinates JDBC-related activities.
Authors
Steve Ebersole, Brett Meyer

Method Summary

Modifier and TypeMethod and Description
public void
abortBatch()

Abort the currently managed batch (if any)

public 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.

public void
afterTransaction()

Signals the end of transaction.

public void
cancelLastQuery()

Attempt to cancel the last query sent to the JDBC driver.

public Connection

Returns:

The Connection associated with the managed logical connection
close
()

Close this coordinator and release and resources.

public <
The result type.
T
>
T

Returns:

The work result.
coordinateWork
(WorkExecutorVisitable<T>
The work to be performed.
work
)

Perform the requested work handling exceptions, coordinating and handling return processing.

public int

Returns:

The number of seconds remaining until until a transaction timeout occurs. A negative value indicates no timeout was requested.
determineRemainingTransactionTimeOutPeriod
()

Calculate the amount of time, in seconds, still remaining before transaction timeout occurs.

public void
disableReleases()

Disable connection releases

public void
enableReleases()

Enable connection releases

public void
executeBatch()

Execute the currently managed batch (if any)

public void
flushBeginning()

Callback to let us know that a flush is beginning.

public void
flushEnding()

Callback to let us know that a flush is ending.

public Batch

Returns:

The batch
getBatch
(BatchKey
The unique batch key.
key
)

Get a batch instance.

public default PhysicalConnectionHandlingMode

Returns:

The JDBC Connection handlng mode
getConnectionHandlingMode
()

Deprecated (since 5.2) access via getLogicalConnection instead
The mode for physical handling of the JDBC Connection
public default ConnectionReleaseMode

Returns:

the release mode.
getConnectionReleaseMode
()

Deprecated (since 5.2) use PhysicalConnectionHandlingMode via getLogicalConnection instead
The release mode under which this logical connection is operating.
public LogicalConnectionImplementor

Returns:

The logical connection
getLogicalConnection
()

Retrieves the logical connection associated with this JDBC coordinator.

public default ResourceRegistry
getResourceRegistry()

Deprecated (since 5.2) access via getLogicalConnection instead
public ResultSetReturn

Returns:

This coordinator's resultset extractor
getResultSetReturn
()

Obtain the resultset extractor associated with this JDBC coordinator.

public StatementPreparer

Returns:

This coordinator's statement preparer
getStatementPreparer
()

Obtain the statement preparer associated with this JDBC coordinator.

public boolean

Returns:

true indicates the coordinator can be serialized.
isReadyForSerialization
()

Can this coordinator be serialized?

public void
registerLastQuery(Statement
The cancel-able query statement.
statement
)

Register a query statement as being able to be cancelled.

public void
serialize(ObjectOutputStream objectOutputStream)

Inherited from org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess:
getResourceLocalTransaction
Inherited from org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner:
afterTransactionBeginafterTransactionCompletionbeforeTransactionCompletionflushBeforeTransactionCompletiongetJdbcSessionOwnerisActivesetTransactionTimeOutstartTransactionBoundary

Method Detail

abortBatchback to summary
public void abortBatch()

Abort the currently managed batch (if any)

afterStatementExecutionback to summary
public 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.

afterTransactionback to summary
public 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.

cancelLastQueryback to summary
public void cancelLastQuery()

Attempt to cancel the last query sent to the JDBC driver.

closeback to summary
public Connection close()

Close this coordinator and release and resources.

Returns:Connection

The Connection associated with the managed logical connection

See Also
org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor#close
coordinateWorkback to summary
public <T> T coordinateWork(WorkExecutorVisitable<T> work)

Perform the requested work handling exceptions, coordinating and handling return processing.

Parameters
<T>
The result type.
work:WorkExecutorVisitable<T>

The work to be performed.

Returns:T

The work result.

determineRemainingTransactionTimeOutPeriodback to summary
public int determineRemainingTransactionTimeOutPeriod()

Calculate the amount of time, in seconds, still remaining before transaction timeout occurs.

Returns:int

The number of seconds remaining until until a transaction timeout occurs. A negative value indicates no timeout was requested.

Exceptions
TransactionException:
Indicates the time out period has already been exceeded.
disableReleasesback to summary
public void disableReleases()

Disable connection releases

enableReleasesback to summary
public void enableReleases()

Enable connection releases

executeBatchback to summary
public void executeBatch()

Execute the currently managed batch (if any)

flushBeginningback to summary
public 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 complete flushEnding()

flushEndingback to summary
public void flushEnding()

Callback to let us know that a flush is ending. We use this fact to stop circumventing aggressive releasing connections.

getBatchback to summary
public Batch getBatch(BatchKey key)

Get a batch instance.

Parameters
key:BatchKey

The unique batch key.

Returns:Batch

The batch

getConnectionHandlingModeback to summary
public default PhysicalConnectionHandlingMode getConnectionHandlingMode()

Deprecated

(since 5.2) access via getLogicalConnection instead

The mode for physical handling of the JDBC Connection

Returns:PhysicalConnectionHandlingMode

The JDBC Connection handlng mode

Annotations
@Deprecated
getConnectionReleaseModeback to summary
public default ConnectionReleaseMode getConnectionReleaseMode()

Deprecated

(since 5.2) use PhysicalConnectionHandlingMode via getLogicalConnection instead

The release mode under which this logical connection is operating.

Returns:ConnectionReleaseMode

the release mode.

Annotations
@Deprecated
getLogicalConnectionback to summary
public LogicalConnectionImplementor getLogicalConnection()

Retrieves the logical connection associated with this JDBC coordinator.

Returns:LogicalConnectionImplementor

The logical connection

getResourceRegistryback to summary
public default ResourceRegistry getResourceRegistry()

Deprecated

(since 5.2) access via getLogicalConnection instead

Annotations
@Deprecated
getResultSetReturnback to summary
public ResultSetReturn getResultSetReturn()

Obtain the resultset extractor associated with this JDBC coordinator.

Returns:ResultSetReturn

This coordinator's resultset extractor

getStatementPreparerback to summary
public StatementPreparer getStatementPreparer()

Obtain the statement preparer associated with this JDBC coordinator.

Returns:StatementPreparer

This coordinator's statement preparer

isReadyForSerializationback to summary
public boolean isReadyForSerialization()

Can this coordinator be serialized?

Returns:boolean

true indicates the coordinator can be serialized.

registerLastQueryback to summary
public void registerLastQuery(Statement statement)

Register a query statement as being able to be cancelled.

Parameters
statement:Statement

The cancel-able query statement.

serializeback to summary
public void serialize(ObjectOutputStream objectOutputStream) throws IOException