|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2014 the original author or authors. |
| 2 | + * Copyright 2002-2016 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
81 | 81 | * Almost all Java EE servers expose it, but do so as extension to EE. There might be some
|
82 | 82 | * issues with compatibility, despite the TransactionManager interface being part of JTA.
|
83 | 83 | * As a consequence, Spring provides various vendor-specific PlatformTransactionManagers,
|
84 |
| - * which are recommended to be used if appropriate: {@link WebLogicJtaTransactionManager}, |
85 |
| - * {@link WebSphereUowTransactionManager} and {@link OC4JJtaTransactionManager}. |
86 |
| - * For all other Java EE servers, the standard JtaTransactionManager is sufficient. |
| 84 | + * which are recommended to be used if appropriate: {@link WebLogicJtaTransactionManager} |
| 85 | + * and {@link WebSphereUowTransactionManager}. For all other Java EE servers, the |
| 86 | + * standard JtaTransactionManager is sufficient. |
87 | 87 | *
|
88 | 88 | * <p>This pure JtaTransactionManager class supports timeouts but not per-transaction
|
89 | 89 | * isolation levels. Custom subclasses may override the {@link #doJtaBegin} method for
|
90 |
| - * specific JTA extensions in order to provide this functionality; Spring includes |
91 |
| - * corresponding {@link WebLogicJtaTransactionManager} and {@link OC4JJtaTransactionManager} |
92 |
| - * classes, for BEA's WebLogic Server and Oracle's OC4J, respectively. Such adapters |
93 |
| - * for specific Java EE transaction coordinators may also expose transaction names for |
94 |
| - * monitoring; with standard JTA, transaction names will simply be ignored. |
| 90 | + * specific JTA extensions in order to provide this functionality; Spring includes a |
| 91 | + * corresponding {@link WebLogicJtaTransactionManager} class for WebLogic Server. Such |
| 92 | + * adapters for specific Java EE transaction coordinators may also expose transaction |
| 93 | + * names for monitoring; with standard JTA, transaction names will simply be ignored. |
95 | 94 | *
|
96 | 95 | * <p><b>Consider using Spring's {@code tx:jta-transaction-manager} configuration
|
97 | 96 | * element for automatically picking the appropriate JTA platform transaction manager
|
98 |
| - * (automatically detecting WebLogic, WebSphere and OC4J).</b> |
| 97 | + * (automatically detecting WebLogic and WebSphere).</b> |
99 | 98 | *
|
100 | 99 | * <p>JTA 1.1 adds the TransactionSynchronizationRegistry facility, as public Java EE 5
|
101 | 100 | * API in addition to the standard JTA UserTransaction handle. As of Spring 2.5, this
|
102 | 101 | * JtaTransactionManager autodetects the TransactionSynchronizationRegistry and uses
|
103 | 102 | * it for registering Spring-managed synchronizations when participating in an existing
|
104 | 103 | * JTA transaction (e.g. controlled by EJB CMT). If no TransactionSynchronizationRegistry
|
105 |
| - * is available (or the JTA 1.1 API isn't available), then such synchronizations |
106 |
| - * will be registered via the (non-EE) JTA TransactionManager handle. |
| 104 | + * is available (or the JTA 1.1 API isn't available), then such synchronizations will be |
| 105 | + * registered via the (non-EE) JTA TransactionManager handle. |
107 | 106 | *
|
108 | 107 | * <p>This class is serializable. However, active synchronizations do not survive serialization.
|
109 | 108 | *
|
@@ -346,7 +345,7 @@ public void setTransactionManager(TransactionManager transactionManager) {
|
346 | 345 | }
|
347 | 346 |
|
348 | 347 | /**
|
349 |
| - * Return the JTA TransactionManager that this transaction manager uses. |
| 348 | + * Return the JTA TransactionManager that this transaction manager uses, if any. |
350 | 349 | */
|
351 | 350 | public TransactionManager getTransactionManager() {
|
352 | 351 | return this.transactionManager;
|
@@ -449,7 +448,7 @@ protected void initUserTransactionAndTransactionManager() throws TransactionSyst
|
449 | 448 | }
|
450 | 449 |
|
451 | 450 | // Autodetect UserTransaction object that implements TransactionManager,
|
452 |
| - // and check fallback JNDI locations else. |
| 451 | + // and check fallback JNDI locations otherwise. |
453 | 452 | if (this.transactionManager == null && this.autodetectTransactionManager) {
|
454 | 453 | this.transactionManager = findTransactionManager(this.userTransaction);
|
455 | 454 | }
|
@@ -738,8 +737,7 @@ protected Object findTransactionSynchronizationRegistry(UserTransaction ut, Tran
|
738 | 737 | }
|
739 | 738 | catch (NamingException ex) {
|
740 | 739 | if (logger.isDebugEnabled()) {
|
741 |
| - logger.debug( |
742 |
| - "No JTA TransactionSynchronizationRegistry found at default JNDI location [" + jndiName + "]", ex); |
| 740 | + logger.debug("No JTA TransactionSynchronizationRegistry found at default JNDI location [" + jndiName + "]", ex); |
743 | 741 | }
|
744 | 742 | }
|
745 | 743 | }
|
@@ -825,12 +823,12 @@ protected void doBegin(Object transaction, TransactionDefinition definition) {
|
825 | 823 | catch (NotSupportedException ex) {
|
826 | 824 | // assume nested transaction not supported
|
827 | 825 | throw new NestedTransactionNotSupportedException(
|
828 |
| - "JTA implementation does not support nested transactions", ex); |
| 826 | + "JTA implementation does not support nested transactions", ex); |
829 | 827 | }
|
830 | 828 | catch (UnsupportedOperationException ex) {
|
831 | 829 | // assume nested transaction not supported
|
832 | 830 | throw new NestedTransactionNotSupportedException(
|
833 |
| - "JTA implementation does not support nested transactions", ex); |
| 831 | + "JTA implementation does not support nested transactions", ex); |
834 | 832 | }
|
835 | 833 | catch (SystemException ex) {
|
836 | 834 | throw new CannotCreateTransactionException("JTA failure on begin", ex);
|
@@ -885,8 +883,8 @@ protected void applyIsolationLevel(JtaTransactionObject txObject, int isolationL
|
885 | 883 |
|
886 | 884 | if (!this.allowCustomIsolationLevels && isolationLevel != TransactionDefinition.ISOLATION_DEFAULT) {
|
887 | 885 | throw new InvalidIsolationLevelException(
|
888 |
| - "JtaTransactionManager does not support custom isolation levels by default - " + |
889 |
| - "switch 'allowCustomIsolationLevels' to 'true'"); |
| 886 | + "JtaTransactionManager does not support custom isolation levels by default - " + |
| 887 | + "switch 'allowCustomIsolationLevels' to 'true'"); |
890 | 888 | }
|
891 | 889 | }
|
892 | 890 |
|
|
0 commit comments