WebLogicJtaTransactionManager
since Oracle end-of-lifed OC4J in favor of WebLogic@Deprecated public class OC4JJtaTransactionManager extends JtaTransactionManager
JtaTransactionManager
variant for Oracle OC4J (10.1.3 and higher).
Supports the full power of Spring's transaction definitions on OC4J's
transaction coordinator, beyond standard JTA: transaction names
and per-transaction isolation levels.
Uses OC4J's special begin(name)
method to start a JTA transaction,
in orderto make Spring-driven transactions visible in OC4J's transaction
monitor. In case of Spring's declarative transactions, the exposed name will
(by default) be the fully-qualified class name + "." + method name.
Supports a per-transaction isolation level through OC4J's corresponding
OC4JTransaction.setTransactionIsolation(int)
method. This will
apply the specified isolation level (e.g. ISOLATION_SERIALIZABLE) to all
JDBC Connections that participate in the given transaction.
Automatically detects the available OC4J server version and adapts accordingly. Supports the "com.evermind.server" package in OC4J 10.1.3.2 as well as the "oracle.j2ee.transaction" package in later OC4J versions.
By default, the JTA UserTransaction and TransactionManager handles are
fetched directly from OC4J's TransactionUtility
in 10.1.3.2+.
This can be overridden by specifying "userTransaction"/"userTransactionName"
and "transactionManager"/"transactionManagerName", passing in existing handles
or specifying corresponding JNDI locations to look up.
Thanks to Oracle for donating the original version of this extended OC4J integration code to the Spring project!
TransactionDefinition.getName()
,
TransactionDefinition.getIsolationLevel()
,
Serialized FormAbstractPlatformTransactionManager.SuspendedResourcesHolder
DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME, DEFAULT_USER_TRANSACTION_NAME, FALLBACK_TRANSACTION_MANAGER_NAMES
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor and Description |
---|
OC4JJtaTransactionManager()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Deprecated.
Initialize the UserTransaction as well as the TransactionManager handle.
|
Transaction |
createTransaction(String name,
int timeout)
Deprecated.
Create an active Transaction object based on the given name and timeout.
|
protected void |
doJtaBegin(JtaTransactionObject txObject,
TransactionDefinition definition)
Deprecated.
Perform a JTA begin on the JTA UserTransaction or TransactionManager.
|
protected UserTransaction |
retrieveUserTransaction()
Deprecated.
Allows subclasses to retrieve the JTA UserTransaction in a vendor-specific manner.
|
applyIsolationLevel, applyTimeout, buildUserTransaction, checkUserTransactionAndTransactionManager, doBegin, doCommit, doGetJtaTransaction, doGetTransaction, doJtaResume, doJtaSuspend, doRegisterAfterCompletionWithJtaTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, findTransactionManager, findTransactionSynchronizationRegistry, findUserTransaction, getJndiEnvironment, getJndiTemplate, getTransactionManager, getUserTransaction, initTransactionSynchronizationRegistry, initUserTransactionAndTransactionManager, isExistingTransaction, lookupTransactionManager, lookupTransactionSynchronizationRegistry, lookupUserTransaction, registerAfterCompletionWithExistingTransaction, retrieveTransactionManager, retrieveTransactionSynchronizationRegistry, setAllowCustomIsolationLevels, setAutodetectTransactionManager, setAutodetectUserTransaction, setCacheUserTransaction, setJndiEnvironment, setJndiTemplate, setTransactionManager, setTransactionManagerName, setTransactionSynchronizationRegistryName, setUserTransaction, setUserTransactionName, shouldCommitOnGlobalRollbackOnly, supportsResourceAdapterManagedTransactions, useSavepointForNestedTransaction
commit, determineTimeout, doCleanupAfterCompletion, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, suspend, triggerBeforeCommit, triggerBeforeCompletion
public void afterPropertiesSet() throws TransactionSystemException
JtaTransactionManager
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class JtaTransactionManager
TransactionSystemException
JtaTransactionManager.initUserTransactionAndTransactionManager()
protected UserTransaction retrieveUserTransaction() throws TransactionSystemException
JtaTransactionManager
The default implementation simply returns null
.
retrieveUserTransaction
in class JtaTransactionManager
null
if none foundTransactionSystemException
- in case of errorsJtaTransactionManager.setUserTransaction(javax.transaction.UserTransaction)
,
JtaTransactionManager.setUserTransactionName(java.lang.String)
protected void doJtaBegin(JtaTransactionObject txObject, TransactionDefinition definition) throws NotSupportedException, SystemException
JtaTransactionManager
This implementation only supports standard JTA functionality: that is, no per-transaction isolation levels and no transaction names. Can be overridden in subclasses, for specific JTA implementations.
Calls applyIsolationLevel
and applyTimeout
before invoking the UserTransaction's begin
method.
doJtaBegin
in class JtaTransactionManager
txObject
- the JtaTransactionObject containing the UserTransactiondefinition
- TransactionDefinition instance, describing propagation
behavior, isolation level, read-only flag, timeout, and transaction nameNotSupportedException
- if thrown by JTA methodsSystemException
- if thrown by JTA methodsJtaTransactionManager.getUserTransaction()
,
JtaTransactionManager.getTransactionManager()
,
JtaTransactionManager.applyIsolationLevel(org.springframework.transaction.jta.JtaTransactionObject, int)
,
JtaTransactionManager.applyTimeout(org.springframework.transaction.jta.JtaTransactionObject, int)
,
JtaTransactionObject.getUserTransaction()
,
UserTransaction.setTransactionTimeout(int)
,
UserTransaction.begin()
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException
TransactionFactory
createTransaction
in interface TransactionFactory
createTransaction
in class JtaTransactionManager
name
- the transaction name (may be null
)timeout
- the transaction timeout (may be -1 for the default timeout)null
)NotSupportedException
- if the transaction manager does not support
a transaction of the specified typeSystemException
- if the transaction manager failed to create the
transaction