public class SpringHostConnectionAccessor extends Object implements HostConnectionAccessor
Host should instantiate and export this.
Host must implement ConnectionProvider.
| Modifier and Type | Class and Description |
|---|---|
static interface |
SpringHostConnectionAccessor.ConnectionProvider
Host specific implementation.
|
| Constructor and Description |
|---|
SpringHostConnectionAccessor(SpringHostConnectionAccessor.ConnectionProvider connectionProvider,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
| 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. |
io.atlassian.fugue.Option<String> |
getSchemaName()
Returns the configured schema name (if any), for connections provided during
HostConnectionAccessor.execute(boolean, boolean, ConnectionCallback) |
public SpringHostConnectionAccessor(@Nonnull SpringHostConnectionAccessor.ConnectionProvider connectionProvider, @Nonnull org.springframework.transaction.PlatformTransactionManager transactionManager)
public <A> A execute(boolean readOnly,
boolean newTransaction,
@Nonnull
ConnectionCallback<A> callback)
HostConnectionAccessorConnection, within a transaction.
It is up to the caller as to whether it attempts to participate in an existing transaction. This is explicitly
explained in TransactionalExecutor.
In the case of the callback returning normally:
autoCommit=false.
The following methods are guaranteed not to be called on connection:
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)execute in interface HostConnectionAccessorreadOnly - connection should be read onlynewTransaction - attempt to create a new transaction even if there is already a "current" transactioncallback - mandatorycallback@Nonnull public io.atlassian.fugue.Option<String> getSchemaName()
HostConnectionAccessorHostConnectionAccessor.execute(boolean, boolean, ConnectionCallback)getSchemaName in interface HostConnectionAccessorCopyright © 2019 Atlassian. All rights reserved.