Package | Description |
---|---|
org.skife.jdbi.v2 |
Start with
DBI and Handle |
org.skife.jdbi.v2.logging | |
org.skife.jdbi.v2.spring |
Classes here provide integration hooks for working with the Spring framework.
|
org.skife.jdbi.v2.sqlobject |
SQL Objects
|
org.skife.jdbi.v2.sqlobject.mixins | |
org.skife.jdbi.v2.tweak |
Interfaces used to alter JDBI's behavior
|
org.skife.jdbi.v2.tweak.transactions |
Several
TransactionHandler instances ae provided for working in
different environments. |
Modifier and Type | Method and Description |
---|---|
Handle |
Handle.begin()
Start a transaction
|
Handle |
Handle.checkpoint(String name)
Create a transaction checkpoint (savepoint in JDBC terminology) with the name provided.
|
Handle |
Handle.commit()
Commit a transaction
|
protected Handle |
SQLStatement.getHandle() |
Handle |
IDBI.open()
Obtain a Handle to the data source wrapped by this DBI instance
|
Handle |
DBI.open()
Obtain a Handle to the data source wrapped by this DBI instance
|
static Handle |
DBI.open(Connection connection)
Create a Handle wrapping a particular JDBC Connection
|
static Handle |
DBI.open(DataSource dataSource)
Convenience methd used to obtain a handle from a specific data source
|
static Handle |
DBI.open(String url)
Obtain a handle with just a JDBC URL
|
static Handle |
DBI.open(String url,
Properties props)
Obtain a handle with just a JDBC URL
|
static Handle |
DBI.open(String url,
String username,
String password)
Obtain a handle with just a JDBC URL
|
Handle |
Handle.release(String checkpointName)
Release a previously created checkpoint
|
Handle |
Handle.rollback()
Rollback a transaction
|
Handle |
Handle.rollback(String checkpointName)
Rollback a transaction to a named checkpoint
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
VoidTransactionCallback.execute(Handle handle,
TransactionStatus status)
VoidTransactionCallback.inTransaction(org.skife.jdbi.v2.Handle, org.skife.jdbi.v2.TransactionStatus) will delegate to this method. |
Void |
VoidTransactionCallback.inTransaction(Handle handle,
TransactionStatus status)
This implementation delegates to
VoidTransactionCallback.execute(org.skife.jdbi.v2.Handle, org.skife.jdbi.v2.TransactionStatus) . |
ReturnType |
TransactionCallback.inTransaction(Handle conn,
TransactionStatus status) |
void |
TransactionConsumer.useTransaction(Handle conn,
TransactionStatus status) |
Modifier and Type | Method and Description |
---|---|
void |
NoOpLog.logBeginTransaction(Handle h) |
void |
FormattedLog.logBeginTransaction(Handle h) |
void |
NoOpLog.logCheckpointTransaction(Handle h,
String name) |
void |
FormattedLog.logCheckpointTransaction(Handle h,
String name) |
void |
NoOpLog.logCommitTransaction(long time,
Handle h) |
void |
FormattedLog.logCommitTransaction(long time,
Handle h) |
void |
NoOpLog.logObtainHandle(long time,
Handle h) |
void |
FormattedLog.logObtainHandle(long time,
Handle h) |
void |
NoOpLog.logReleaseCheckpointTransaction(Handle h,
String name) |
void |
FormattedLog.logReleaseCheckpointTransaction(Handle h,
String name) |
void |
NoOpLog.logReleaseHandle(Handle h) |
void |
FormattedLog.logReleaseHandle(Handle h) |
void |
NoOpLog.logRollbackToCheckpoint(long time,
Handle h,
String checkpointName) |
void |
FormattedLog.logRollbackToCheckpoint(long time,
Handle h,
String checkpointName) |
void |
NoOpLog.logRollbackTransaction(long time,
Handle h) |
void |
FormattedLog.logRollbackTransaction(long time,
Handle h) |
Modifier and Type | Method and Description |
---|---|
static Handle |
DBIUtil.getHandle(IDBI dbi)
Obtain a Handle instance, either the transactionally bound one if we are in a transaction,
or a new one otherwise.
|
Modifier and Type | Method and Description |
---|---|
static void |
DBIUtil.closeIfNeeded(Handle h)
Close a handle if it is not transactionally bound, otherwise no-op
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
SqlObjectBuilder.attach(Handle handle,
Class<T> sqlObjectType)
Create a a sql object of the specified type bound to this handle.
|
Modifier and Type | Method and Description |
---|---|
Handle |
GetHandle.getHandle()
Obtain the handle associated to this sql object.
|
Modifier and Type | Method and Description |
---|---|
void |
TransactionHandler.begin(Handle handle)
Called when a transaction is started
|
void |
TransactionHandler.checkpoint(Handle handle,
String name)
Create a new checkpoint (savepoint in JDBC terminology)
|
void |
TransactionHandler.commit(Handle handle)
Called when a transaction is committed
|
protected abstract void |
VoidHandleCallback.execute(Handle handle)
VoidHandleCallback.withHandle(org.skife.jdbi.v2.Handle) will delegate to this method. |
<ReturnType> |
TransactionHandler.inTransaction(Handle handle,
TransactionCallback<ReturnType> callback)
Run a transaction.
|
<ReturnType> |
TransactionHandler.inTransaction(Handle handle,
TransactionIsolationLevel level,
TransactionCallback<ReturnType> callback)
Run a transaction.
|
boolean |
TransactionHandler.isInTransaction(Handle handle)
Called to test if a handle is in a transaction
|
void |
SQLLog.logBeginTransaction(Handle h)
Called when a transaction is started
|
void |
SQLLog.logCheckpointTransaction(Handle h,
String name)
Called when a transaction is checkpointed
|
void |
SQLLog.logCommitTransaction(long time,
Handle h)
Called when a transaction is committed
|
void |
SQLLog.logObtainHandle(long time,
Handle h)
Called when a handle is opened from a DBI instance
|
void |
SQLLog.logReleaseCheckpointTransaction(Handle h,
String name)
Called when a transaction checkpoint is released
|
void |
SQLLog.logReleaseHandle(Handle h)
Called when a handle is closed
|
void |
SQLLog.logRollbackToCheckpoint(long time,
Handle h,
String checkpointName)
Called when a transaction checkpoint is rolled back to
|
void |
SQLLog.logRollbackTransaction(long time,
Handle h)
Called when a transaction is committed
|
void |
TransactionHandler.release(Handle handle,
String checkpointName)
Release a previously created checkpoint
|
void |
TransactionHandler.rollback(Handle handle)
Called when a transaction is rolled back
|
void |
TransactionHandler.rollback(Handle handle,
String name)
Roll back to a named checkpoint
|
void |
HandleConsumer.useHandle(Handle handle)
Will be invoked with an open Handle.
|
Void |
VoidHandleCallback.withHandle(Handle handle)
This implementation delegates to
VoidHandleCallback.execute(org.skife.jdbi.v2.Handle) . |
T |
HandleCallback.withHandle(Handle handle)
Will be invoked with an open Handle.
|
Modifier and Type | Method and Description |
---|---|
void |
LocalTransactionHandler.begin(Handle handle)
Called when a transaction is started
|
void |
DelegatingTransactionHandler.begin(Handle handle) |
void |
CMTTransactionHandler.begin(Handle handle)
Called when a transaction is started
|
void |
LocalTransactionHandler.checkpoint(Handle handle,
String name)
Create a new checkpoint (savepoint in JDBC terminology)
|
void |
DelegatingTransactionHandler.checkpoint(Handle handle,
String name) |
void |
CMTTransactionHandler.checkpoint(Handle handle,
String name)
Create a new checkpoint (savepoint in JDBC terminology)
|
void |
LocalTransactionHandler.commit(Handle handle)
Called when a transaction is committed
|
void |
DelegatingTransactionHandler.commit(Handle handle) |
void |
CMTTransactionHandler.commit(Handle handle)
Called when a transaction is committed
|
<ReturnType> |
SerializableTransactionRunner.inTransaction(Handle handle,
TransactionCallback<ReturnType> callback) |
<ReturnType> |
LocalTransactionHandler.inTransaction(Handle handle,
TransactionCallback<ReturnType> callback) |
<ReturnType> |
DelegatingTransactionHandler.inTransaction(Handle handle,
TransactionCallback<ReturnType> callback) |
<ReturnType> |
CMTTransactionHandler.inTransaction(Handle handle,
TransactionCallback<ReturnType> callback) |
<ReturnType> |
SerializableTransactionRunner.inTransaction(Handle handle,
TransactionIsolationLevel level,
TransactionCallback<ReturnType> callback) |
<ReturnType> |
LocalTransactionHandler.inTransaction(Handle handle,
TransactionIsolationLevel level,
TransactionCallback<ReturnType> callback) |
<ReturnType> |
DelegatingTransactionHandler.inTransaction(Handle handle,
TransactionIsolationLevel level,
TransactionCallback<ReturnType> callback) |
<ReturnType> |
CMTTransactionHandler.inTransaction(Handle handle,
TransactionIsolationLevel level,
TransactionCallback<ReturnType> callback) |
boolean |
LocalTransactionHandler.isInTransaction(Handle handle)
Called to test if a handle is in a transaction
|
boolean |
DelegatingTransactionHandler.isInTransaction(Handle handle) |
boolean |
CMTTransactionHandler.isInTransaction(Handle handle)
Called to test if a handle is in a transaction
|
void |
LocalTransactionHandler.release(Handle handle,
String name) |
void |
DelegatingTransactionHandler.release(Handle handle,
String checkpointName) |
void |
CMTTransactionHandler.release(Handle handle,
String checkpointName)
Release a previously created checkpoint
|
void |
LocalTransactionHandler.rollback(Handle handle)
Called when a transaction is rolled back
|
void |
DelegatingTransactionHandler.rollback(Handle handle) |
void |
CMTTransactionHandler.rollback(Handle handle)
Called when a transaction is rolled back
Will throw a RuntimeException to force transactional rollback
|
void |
LocalTransactionHandler.rollback(Handle handle,
String name)
Roll back to a named checkpoint
|
void |
DelegatingTransactionHandler.rollback(Handle handle,
String name) |
void |
CMTTransactionHandler.rollback(Handle handle,
String name)
Roll back to a named checkpoint
|
Copyright © 2018. All rights reserved.