svn commit: r567521 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r567521 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

jonesde
Author: jonesde
Date: Sun Aug 19 19:06:11 2007
New Revision: 567521

URL: http://svn.apache.org/viewvc?rev=567521&view=rev
Log:
Fixed transaction bug in FinAccount processing that caused a deadlock, comments included to describe problem and solution

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=567521&r1=567520&r2=567521&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Sun Aug 19 19:06:11 2007
@@ -1555,7 +1555,13 @@
         // now invoke the capture service
         Map captureResult = null;
         try {
-            captureResult = dispatcher.runSync(serviceName, captureContext, TX_TIME, true);
+            // NOTE DEJ20070819 calling this with a new transaction synchronously caused a deadlock because in this
+            //transaction OrderHeader was updated and with this transaction paused and waiting for the new transaction
+            //and the new transaction was waiting trying to read the same OrderHeader record; note that this only happens
+            //for FinAccounts because they are processed internally whereas others are not
+            // NOTE HOW TO FIX: don't call in separate transaction from here; individual services can have require-new-transaction
+            //set to true if they want to behave that way (had: [, TX_TIME, true])
+            captureResult = dispatcher.runSync(serviceName, captureContext);
         } catch (GenericServiceException e) {
             Debug.logError(e, "Could not capture payment ... serviceName: " + serviceName + " ... context: " + captureContext, module);
             return null;