openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r577077 - in /openjpa/branches/1.0.x/openjpa-kernel/src/main: java/org/apache/openjpa/kernel/BrokerImpl.java resources/org/apache/openjpa/kernel/localizer.properties
Date Tue, 18 Sep 2007 21:47:54 GMT
Author: mikedd
Date: Tue Sep 18 14:47:53 2007
New Revision: 577077

URL: http://svn.apache.org/viewvc?rev=577077&view=rev
Log:
OPENJPA-343 merging to 1.0.x. Original changes under rev 571523

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

Modified: openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=577077&r1=577076&r2=577077&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
(original)
+++ openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
Tue Sep 18 14:47:53 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/branches/1.0.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?rev=577077&r1=577076&r2=577077&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
(original)
+++ openjpa/branches/1.0.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
Tue Sep 18 14:47:53 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