public interface HostConnectionAccessor
Connection, in the context of a transaction.
Host must export this.
Host must implement this; may use SpringHostConnectionAccessor| Modifier and Type | Method and Description |
|---|---|
<A> A |
execute(boolean readOnly,
boolean newTransaction,
ConnectionCallback<A> callback)
Execute a callback which is supplied a
Connection, within a transaction. |
com.atlassian.fugue.Option<String> |
getSchemaName()
Returns the configured schema name (if any), for connections provided during
execute(boolean, boolean, ConnectionCallback) |
<A> A execute(boolean readOnly,
boolean newTransaction,
@Nonnull
ConnectionCallback<A> callback)
Connection, within a transaction.
It is up to the host as to whether it attempts to participate in an existing transaction. This is explicitly
explained to the consumer in TransactionalExecutor.
The host must ensure that the Connection provided to the ConnectionCallback has autoCommit=false.
Connection.commit() or Connection.rollback() will be called immediately prior
to return. It may be necessary to wrap the connection passed to callback in the case
of newTransaction being false, so that the entire transaction is not committed too early.
The following methods are guaranteed not to be called on connection during the execution of
callback:
Connection.setAutoCommit(boolean)
Connection.commit()
Connection.close()
Connection.rollback()
Connection.setReadOnly(boolean)
Connection.abort(java.util.concurrent.Executor)
Connection.setCatalog(String)
Connection.setSchema(String)
Connection.setTransactionIsolation(int)
Connection.setNetworkTimeout(java.util.concurrent.Executor, int)readOnly - connection should be read onlynewTransaction - attempt to create a new transaction even if there is already a "current" transactioncallback - mandatorycallback@Nonnull com.atlassian.fugue.Option<String> getSchemaName()
execute(boolean, boolean, ConnectionCallback)Copyright © 2015 Atlassian. All rights reserved.