openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwsut...@apache.org
Subject svn commit: r571523 - in /openjpa/trunk/openjpa-kernel/src/main: java/org/apache/openjpa/kernel/BrokerImpl.java resources/org/apache/openjpa/kernel/localizer.properties
Date Fri, 31 Aug 2007 16:55:52 GMT
Author: kwsutter
Date: Fri Aug 31 09:55:51 2007
New Revision: 571523

URL: http://svn.apache.org/viewvc?rev=571523&view=rev
Log:
OPENJPA-343.  Modified the call to setRollbackOnly to check for a valid Transaction status
first.  If the Transaction is not in a valid state, then we will log a trace message indicating
such failure.  Processing will continue though.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
    openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=571523&r1=571522&r2=571523&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Fri
Aug 31 09:55:51 2007
@@ -1430,7 +1430,15 @@
                 _runtime.getTransactionManager().getTransaction();
             if (trans == null)
                 throw new InvalidStateException(_loc.get("null-trans"));
-            _runtime.setRollbackOnly(cause);
+            // ensure tran is in a valid state to accept the setRollbackOnly
+            int tranStatus = trans.getStatus();
+            if ((tranStatus != Status.STATUS_NO_TRANSACTION)
+                    && (tranStatus != Status.STATUS_ROLLEDBACK)
+                    && (tranStatus != Status.STATUS_COMMITTED))
+                _runtime.setRollbackOnly(cause);
+            else if (_log.isTraceEnabled())
+                _log.trace(_loc.get("invalid-tran-status", new Integer(
+                        tranStatus), "setRollbackOnly"));
         } catch (OpenJPAException ke) {
             throw ke;
         } catch (Exception e) {

Modified: openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?rev=571523&r1=571522&r2=571523&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
Fri Aug 31 09:55:51 2007
@@ -373,3 +373,5 @@
 provided via an initializer or by calling the setter method.  You either need \
 to remove the @GeneratedValue annotation or modify the code to remove the \
 initializer processing.
+invalid-tran-status: The transaction was not in a valid state ({0}) to \
+accept the "{1}" method invocation.  Processing will continue.
\ No newline at end of file



Mime
View raw message