| |
|
| java.lang.Object org.springframework.transaction.support.AbstractPlatformTransactionManager org.springframework.orm.toplink.TopLinkTransactionManager
TopLinkTransactionManager | public TopLinkTransactionManager(SessionFactory sessionFactory)(Code) | | Create a new TopLinkTransactionManager instance.
Parameters: sessionFactory - the TopLink SessionFactory to manage transactions for |
afterPropertiesSet | public void afterPropertiesSet()(Code) | | |
doCleanupAfterCompletion | protected void doCleanupAfterCompletion(Object transaction)(Code) | | |
getDataSource | public DataSource getDataSource()(Code) | | Return the JDBC DataSource that this instance manages transactions for.
|
getJdbcConnection | protected Connection getJdbcConnection(Session session)(Code) | | Extract the underlying JDBC Connection from the given TopLink Session.
Default implementation casts to oracle.toplink.publicinterface.Session
and fetches the Connection from the DatabaseAccessor exposed there.
Parameters: session - the current TopLink Session the underlying JDBC Connection, or null if none found See Also: oracle.toplink.publicinterface.Session.getAccessor See Also: oracle.toplink.internal.databaseaccess.DatabaseAccessor.getConnection |
getJdbcExceptionTranslator | public SQLExceptionTranslator getJdbcExceptionTranslator()(Code) | | Return the JDBC exception translator for this transaction manager, if any.
|
getSessionFactory | public SessionFactory getSessionFactory()(Code) | | Return the SessionFactory that this instance should manage transactions for.
|
isExistingTransaction | protected boolean isExistingTransaction(Object transaction)(Code) | | |
isLazyDatabaseTransaction | public boolean isLazyDatabaseTransaction()(Code) | | Return whether to lazily start a database transaction within a TopLink
transaction.
|
setDataSource | public void setDataSource(DataSource dataSource)(Code) | | Set the JDBC DataSource that this instance should manage transactions for.
The DataSource should match the one used by the TopLink SessionFactory:
for example, you could specify the same JNDI DataSource for both.
A transactional JDBC Connection for this DataSource will be provided to
application code accessing this DataSource directly via DataSourceUtils
or JdbcTemplate. The Connection will be taken from the TopLink Session.
This will only happen for transactions that are not marked
as read-only. TopLink does not support database transactions for pure
read-only operations on a Session (that is, without a UnitOfWork).
Note that you need to use a TopLink Session with a DatabaseAccessor
to allow for exposing TopLink transactions as JDBC transactions. This is
the case of all standard TopLink configurations.
The DataSource specified here should be the target DataSource to manage
transactions for, not a TransactionAwareDataSourceProxy. Only data access
code may work with TransactionAwareDataSourceProxy, while the transaction
manager needs to work on the underlying target DataSource. If there's
nevertheless a TransactionAwareDataSourceProxy passed in, it will be
unwrapped to extract its target DataSource.
See Also: org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy See Also: org.springframework.jdbc.datasource.DataSourceUtils See Also: org.springframework.jdbc.core.JdbcTemplate |
setLazyDatabaseTransaction | public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction)(Code) | | Set whether to lazily start a database transaction within a TopLink
transaction.
By default, database transactions are started early. This allows
for reusing the same JDBC Connection throughout an entire transaction,
including read operations, and also for exposing TopLink transactions
to JDBC access code (working on the same DataSource).
It is only recommended to switch this flag to "true" when no JDBC access
code is involved in any of the transactions, and when it is acceptable to
perform read operations outside of the transactional JDBC Connection.
See Also: TopLinkTransactionManager.setDataSource(javax.sql.DataSource) See Also: oracle.toplink.sessions.UnitOfWork.beginEarlyTransaction |
setSessionFactory | public void setSessionFactory(SessionFactory sessionFactory)(Code) | | Set the the TopLink SessionFactory to manage transactions for.
This will usually be a ServerSessionFactory.
The passed-in SessionFactory will be asked for a plain Session
in case of a read-only transaction (where no active UnitOfWork is
supposed to be available), and for a managed Session else (with an
active UnitOfWork that will be committed by this transaction manager).
See Also: ServerSessionFactory See Also: SessionFactory.createSession See Also: SessionFactory.createManagedClientSession |
Fields inherited from org.springframework.transaction.support.AbstractPlatformTransactionManager | final public static int SYNCHRONIZATION_ALWAYS(Code)(Java Doc) final public static int SYNCHRONIZATION_NEVER(Code)(Java Doc) final public static int SYNCHRONIZATION_ON_ACTUAL_TRANSACTION(Code)(Java Doc) protected transient Log logger(Code)(Java Doc)
|
Methods inherited from org.springframework.transaction.support.AbstractPlatformTransactionManager | final public void commit(TransactionStatus status) throws TransactionException(Code)(Java Doc) protected int determineTimeout(TransactionDefinition definition)(Code)(Java Doc) abstract protected void doBegin(Object transaction, TransactionDefinition definition) throws TransactionException(Code)(Java Doc) protected void doCleanupAfterCompletion(Object transaction)(Code)(Java Doc) abstract protected void doCommit(DefaultTransactionStatus status) throws TransactionException(Code)(Java Doc) abstract protected Object doGetTransaction() throws TransactionException(Code)(Java Doc) protected void doResume(Object transaction, Object suspendedResources) throws TransactionException(Code)(Java Doc) abstract protected void doRollback(DefaultTransactionStatus status) throws TransactionException(Code)(Java Doc) protected void doSetRollbackOnly(DefaultTransactionStatus status) throws TransactionException(Code)(Java Doc) protected Object doSuspend(Object transaction) throws TransactionException(Code)(Java Doc) final public int getDefaultTimeout()(Code)(Java Doc) final public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException(Code)(Java Doc) final public int getTransactionSynchronization()(Code)(Java Doc) final protected void invokeAfterCompletion(List synchronizations, int completionStatus)(Code)(Java Doc) protected boolean isExistingTransaction(Object transaction) throws TransactionException(Code)(Java Doc) final public boolean isFailEarlyOnGlobalRollbackOnly()(Code)(Java Doc) final public boolean isGlobalRollbackOnParticipationFailure()(Code)(Java Doc) final public boolean isNestedTransactionAllowed()(Code)(Java Doc) final public boolean isRollbackOnCommitFailure()(Code)(Java Doc) protected DefaultTransactionStatus newTransactionStatus(TransactionDefinition definition, Object transaction, boolean newTransaction, boolean newSynchronization, boolean debug, Object suspendedResources)(Code)(Java Doc) protected void registerAfterCompletionWithExistingTransaction(Object transaction, List synchronizations) throws TransactionException(Code)(Java Doc) final protected void resume(Object transaction, SuspendedResourcesHolder resourcesHolder) throws TransactionException(Code)(Java Doc) final public void rollback(TransactionStatus status) throws TransactionException(Code)(Java Doc) final public void setDefaultTimeout(int defaultTimeout)(Code)(Java Doc) final public void setFailEarlyOnGlobalRollbackOnly(boolean failEarlyOnGlobalRollbackOnly)(Code)(Java Doc) final public void setGlobalRollbackOnParticipationFailure(boolean globalRollbackOnParticipationFailure)(Code)(Java Doc) final public void setNestedTransactionAllowed(boolean nestedTransactionAllowed)(Code)(Java Doc) final public void setRollbackOnCommitFailure(boolean rollbackOnCommitFailure)(Code)(Java Doc) final public void setTransactionSynchronization(int transactionSynchronization)(Code)(Java Doc) final public void setTransactionSynchronizationName(String constantName)(Code)(Java Doc) protected boolean shouldCommitOnGlobalRollbackOnly()(Code)(Java Doc) final protected SuspendedResourcesHolder suspend(Object transaction) throws TransactionException(Code)(Java Doc) final protected void triggerBeforeCommit(DefaultTransactionStatus status)(Code)(Java Doc) final protected void triggerBeforeCompletion(DefaultTransactionStatus status)(Code)(Java Doc) protected boolean useSavepointForNestedTransaction()(Code)(Java Doc)
|
|
|
|