|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.interface21.transaction.support.AbstractPlatformTransactionManager
|
+--com.interface21.orm.jdo.JdoTransactionManager
PlatformTransactionManager implementation for single JDO persistence manager factories. Binds a JDO PersistenceManager from the specified factory to the thread, potentially allowing for one thread PersistenceManager per factory. PersistenceManagerFactoryUtils and JdoTemplate are aware of thread-bound persistence managers and take part in such transactions automatically. Using either is required for JDO access code supporting this transaction handling mechanism.
This implementation is appropriate for applications that solely use JDO for transactional data access. JTA resp. JtaTransactionManager is necessary for accessing multiple transactional resources. Unfortunately, there is no way of using JTA with a local JDO PersistenceManagerFactory, at least not with popular implementations like Kodo and Lido. One needs to deploy the respective JCA connector to be able to take part in JTA transactions.
Note that Hibernate can take part in JTA transactions even with a local Hibernate SessionFactory. Due to Spring's transaction synchronization support, this doesn't even involve container-specific setup when using Hibernate's transactional JVM-level cache.
PersistenceManagerFactoryUtils.getPersistenceManager(javax.jdo.PersistenceManagerFactory, boolean),
PersistenceManagerFactoryUtils.closePersistenceManagerIfNecessary(javax.jdo.PersistenceManager, javax.jdo.PersistenceManagerFactory),
JdoTemplate.execute(com.interface21.orm.jdo.JdoCallback),
HibernateTransactionManager| Fields inherited from class com.interface21.transaction.support.AbstractPlatformTransactionManager |
logger |
| Constructor Summary | |
JdoTransactionManager()
Create a new JdoTransactionManager instance. |
|
JdoTransactionManager(javax.jdo.PersistenceManagerFactory pmf)
Create a new JdoTransactionManager instance. |
|
| Method Summary | |
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied. |
protected void |
doBegin(java.lang.Object transaction,
int isolationLevel,
int timeout)
Begin a new transaction with the given isolation level. |
protected void |
doCommit(TransactionStatus status)
Perform an actual commit on the given transaction. |
protected java.lang.Object |
doGetTransaction()
Return a current transaction object, i.e. a JTA UserTransaction. |
protected void |
doRollback(TransactionStatus status)
Perform an actual rollback on the given transaction. |
protected void |
doSetRollbackOnly(TransactionStatus status)
Set the given transaction rollback-only. |
javax.jdo.PersistenceManagerFactory |
getPersistenceManagerFactory()
Return the PersistenceManagerFactory that this instance should manage transactions for. |
protected boolean |
isExistingTransaction(java.lang.Object transaction)
Check if the given transaction object indicates an existing, i.e. already begun, transaction. |
void |
setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
Set the PersistenceManagerFactory that this instance should manage transactions for. |
| Methods inherited from class com.interface21.transaction.support.AbstractPlatformTransactionManager |
commit, getAllowNonTransactionalExecution, getTransaction, getTransactionSynchronization, rollback, setAllowNonTransactionalExecution, setTransactionSynchronization |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JdoTransactionManager()
setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory)public JdoTransactionManager(javax.jdo.PersistenceManagerFactory pmf)
pmf - PersistenceManagerFactory to manage transactions for| Method Detail |
public void setPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
public void afterPropertiesSet()
InitializingBeanafterPropertiesSet in interface InitializingBeancom.interface21.beans.factory.InitializingBeanjava.lang.Exception - in the event of misconfiguration (such
as failure to set an essential property) or if initialization fails.
protected java.lang.Object doGetTransaction()
throws CannotCreateTransactionException,
TransactionException
AbstractPlatformTransactionManagerdoGetTransaction in class AbstractPlatformTransactionManagercom.interface21.transaction.support.AbstractPlatformTransactionManagerCannotCreateTransactionException - if transaction support is
not available (e.g. no JTA UserTransaction retrievable from JNDI)TransactionException - in case of lookup or system errors
protected boolean isExistingTransaction(java.lang.Object transaction)
throws TransactionException
AbstractPlatformTransactionManagerisExistingTransaction in class AbstractPlatformTransactionManagercom.interface21.transaction.support.AbstractPlatformTransactionManagertransaction - transaction object returned by doGetTransaction()TransactionException - in case of system errors
protected void doBegin(java.lang.Object transaction,
int isolationLevel,
int timeout)
throws TransactionException
AbstractPlatformTransactionManagerdoBegin in class AbstractPlatformTransactionManagercom.interface21.transaction.support.AbstractPlatformTransactionManagertransaction - transaction object returned by doGetTransaction()isolationLevel - desired isolation leveltimeout - transaction timeout (in seconds)TransactionException - in case of creation or system errors
protected void doCommit(TransactionStatus status)
throws TransactionException
AbstractPlatformTransactionManagerdoCommit in class AbstractPlatformTransactionManagercom.interface21.transaction.support.AbstractPlatformTransactionManagerstatus - status representation of the transactionTransactionException - in case of commit or system errors
protected void doRollback(TransactionStatus status)
throws TransactionException
AbstractPlatformTransactionManagerdoRollback in class AbstractPlatformTransactionManagercom.interface21.transaction.support.AbstractPlatformTransactionManagerstatus - status representation of the transactionTransactionException - in case of system errors
protected void doSetRollbackOnly(TransactionStatus status)
throws TransactionException
AbstractPlatformTransactionManagerdoSetRollbackOnly in class AbstractPlatformTransactionManagercom.interface21.transaction.support.AbstractPlatformTransactionManagerstatus - status representation of the transactionTransactionException - in case of system errors
|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||