|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.skife.jdbi.spring.DBIUtils
public class DBIUtils
Utility functions for use with spring transaction systems
Constructor Summary | |
---|---|
DBIUtils()
|
Method Summary | |
---|---|
static void |
closeHandleIfNecessary(Handle h,
IDBI dbi)
When used in conjuntion with Handle#getHandle() will only close the
handle if it is not bound to an ongoing Spring transaction. |
static Handle |
getHandle(IDBI dbi)
Obtain a handle from dbi , using the transactionally bound
one if there is one, otherwise a new one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBIUtils()
Method Detail |
---|
public static Handle getHandle(IDBI dbi) throws DBIException
dbi
, using the transactionally bound
one if there is one, otherwise a new one. If spring managed transactions are
in effect than resources will be cleaned up by Spring, otherwise you are
responsible for resource cleanup
DBIException
public static void closeHandleIfNecessary(Handle h, IDBI dbi)
Handle#getHandle()
will only close the
handle if it is not bound to an ongoing Spring transaction. If it is bound to a
transaction then the Handle will be closed when the transaction completes
and this will noop.
h
- Handle to consider closingdbi
- DBI handle was obtained from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |