|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.ojb.OjbFactoryUtils
public abstract class 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
Field Summary | |
---|---|
static int |
PERSISTENCE_BROKER_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up OJB PersistenceBrokers. |
Constructor Summary | |
---|---|
OjbFactoryUtils()
|
Method Summary | |
---|---|
static void |
closePersistenceBrokerIfNecessary(org.apache.ojb.broker.PersistenceBroker pb,
org.apache.ojb.broker.PBKey pbKey)
Deprecated. in favor of releasePersistenceBroker |
static org.apache.ojb.broker.PersistenceBroker |
getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey,
boolean allowCreate)
Get an OJB PersistenceBroker for the given PBKey. |
static void |
releasePersistenceBroker(org.apache.ojb.broker.PersistenceBroker pb,
org.apache.ojb.broker.PBKey pbKey)
Close the given PersistenceBroker, created for the given PBKey, if it is not managed externally (i.e. not bound to the thread). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PERSISTENCE_BROKER_SYNCHRONIZATION_ORDER
Constructor Detail |
---|
public OjbFactoryUtils()
Method Detail |
---|
public static org.apache.ojb.broker.PersistenceBroker getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey, boolean allowCreate) throws DataAccessResourceFailureException, IllegalStateException
pbKey
- PBKey to create the PersistenceBroker forallowCreate
- if a non-transactional PersistenceBroker should be created
when no transactional PersistenceBroker can be found for the current thread
DataAccessResourceFailureException
- if the PersistenceBroker couldn't be created
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)
public static void releasePersistenceBroker(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 |