public class Neo4jTransactionManager extends AbstractPlatformTransactionManager implements ResourceTransactionManager, BeanFactoryAware, InitializingBean
PlatformTransactionManager implementation
for a single Neo4j OGM SessionFactory. Binds a Neo4j OGM
Session from the specified factory to the thread, potentially allowing for
one thread-bound Session per factory. SharedSessionCreator
is aware of thread-bound session and participates
in such transactions automatically. It is required for Neo4j OGM access code
supporting this transaction management mechanism.
This transaction manager is appropriate for applications that use a single
Neo4j OGM SessionFactory for transactional data access. JTA (usually through
JtaTransactionManager) has not been tested
or considered at the moment.
This transaction manager does not support nested transactions or requires new propagation.
setSessionFactory(org.neo4j.ogm.session.SessionFactory),
Serialized Formlogger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION| Constructor and Description |
|---|
Neo4jTransactionManager()
Create a new Neo4jTransactionManager instance.
|
Neo4jTransactionManager(org.neo4j.ogm.session.SessionFactory sessionFactory)
Create a new Neo4jTransactionManager instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
doBegin(Object transaction,
TransactionDefinition definition) |
protected void |
doCleanupAfterCompletion(Object transaction) |
protected void |
doCommit(DefaultTransactionStatus status) |
protected Object |
doGetTransaction() |
protected void |
doResume(Object transaction,
Object suspendedResources) |
protected void |
doRollback(DefaultTransactionStatus status) |
protected void |
doSetRollbackOnly(DefaultTransactionStatus status) |
protected Object |
doSuspend(Object transaction) |
Object |
getResourceFactory() |
org.neo4j.ogm.session.SessionFactory |
getSessionFactory()
Return the SessionFactory that this instance should manage transactions for.
|
protected boolean |
isExistingTransaction(Object transaction) |
void |
setBeanFactory(BeanFactory beanFactory)
Retrieves a default SessionFactory bean.
|
void |
setSessionFactory(org.neo4j.ogm.session.SessionFactory sessionFactory)
Set the SessionFactory that this instance should manage transactions for.
|
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransactionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommit, getTransaction, rollbackpublic Neo4jTransactionManager()
An SessionFactory has to be set to be able to use it.
setSessionFactory(SessionFactory)public Neo4jTransactionManager(org.neo4j.ogm.session.SessionFactory sessionFactory)
sessionFactory - SessionFactory to manage transactions forpublic void setSessionFactory(org.neo4j.ogm.session.SessionFactory sessionFactory)
By default, a default SessionFactory will be retrieved by finding a single unique bean of type SessionFactory in the containing BeanFactory.
public org.neo4j.ogm.session.SessionFactory getSessionFactory()
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionpublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic Object getResourceFactory()
getResourceFactory in interface ResourceTransactionManagerprotected Object doGetTransaction()
doGetTransaction in class AbstractPlatformTransactionManagerprotected boolean isExistingTransaction(Object transaction)
isExistingTransaction in class AbstractPlatformTransactionManagerprotected void doBegin(Object transaction, TransactionDefinition definition) throws TransactionException
doBegin in class AbstractPlatformTransactionManagerTransactionExceptionprotected Object doSuspend(Object transaction)
doSuspend in class AbstractPlatformTransactionManagerprotected void doResume(Object transaction, Object suspendedResources)
doResume in class AbstractPlatformTransactionManagerprotected void doCommit(DefaultTransactionStatus status)
doCommit in class AbstractPlatformTransactionManagerprotected void doRollback(DefaultTransactionStatus status)
doRollback in class AbstractPlatformTransactionManagerprotected void doSetRollbackOnly(DefaultTransactionStatus status)
doSetRollbackOnly in class AbstractPlatformTransactionManagerprotected void doCleanupAfterCompletion(Object transaction)
doCleanupAfterCompletion in class AbstractPlatformTransactionManagerCopyright © 2011-2015–2017 Pivotal Software, Inc.. All rights reserved.