|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.ojb.OjbFactoryUtils
Helper class featuring methods for OJB PersistenceBroker handling, allowing for reuse of PersistenceBroker instances within transactions.
Used by PersistenceBrokerTemplate and PersistenceBrokerTransactionManager. Can also be used directly in application code.
PersistenceBrokerTemplate
,
PersistenceBrokerTransactionManager
,
JtaTransactionManager
Constructor Summary | |
OjbFactoryUtils()
|
Method Summary | |
static void |
closePersistenceBrokerIfNecessary(org.apache.ojb.broker.PersistenceBroker pb,
org.apache.ojb.broker.PBKey pbKey)
Close the given PersistenceBroker, created for the given PBKey, if it isn't bound to the thread. |
static org.apache.ojb.broker.PersistenceBroker |
getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey,
boolean allowCreate)
Get an OJB PersistenceBroker for the given PBKey. |
static org.apache.ojb.broker.PersistenceBroker |
getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey,
boolean allowCreate,
boolean allowSynchronization)
Get an OJB PersistenceBroker for the given PBKey. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OjbFactoryUtils()
Method Detail |
public static org.apache.ojb.broker.PersistenceBroker getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey, boolean allowCreate) throws DataAccessResourceFailureException, java.lang.IllegalStateException
pbKey
- PBKey to create the PersistenceBroker forallowCreate
- if a new PersistenceBroker should be created if no thread-bound found
DataAccessResourceFailureException
- if the PersistenceBroker couldn't be created
java.lang.IllegalStateException
- if no thread-bound PersistenceBroker found and allowCreate falsepublic static org.apache.ojb.broker.PersistenceBroker getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey, boolean allowCreate, boolean allowSynchronization) throws DataAccessResourceFailureException, java.lang.IllegalStateException
pbKey
- PBKey to create the PersistenceBroker forallowCreate
- if a new PersistenceBroker should be created if no thread-bound foundallowSynchronization
- if a new OJB PersistenceBroker is supposed to be
registered with transaction synchronization (if synchronization is active).
This will always be true for typical data access code.
DataAccessResourceFailureException
- if the PersistenceBroker couldn't be created
java.lang.IllegalStateException
- if no thread-bound PersistenceBroker found and allowCreate falsepublic static void closePersistenceBrokerIfNecessary(org.apache.ojb.broker.PersistenceBroker pb, org.apache.ojb.broker.PBKey pbKey)
pb
- PersistenceBroker to closepbKey
- PBKey that the PersistenceBroker was created with
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |