[ 
http://issues.apache.org/jira/browse/OFBIZ-503?page=comments#action_12454470 ] 
            
David E. Jones commented on OFBIZ-503:
--------------------------------------

Thanks for looking at this Si. That's an interesting ommision, I wonder how it 
happened...

This is in SVN rev 480741, but is a bit different than what you put in. If uses 
the static method to get the RollbackOnlyCause object instead of accessing the 
structure directly, and goes a bit further in getting messages and passing back 
the cause exception instead of the rollback error exception. I also threw in 
the stuff that requires Java 1.4 that had been commented out for a while to use 
the getCause method on Throwable, so that may help certain things too. Of 
course, the RollbackOnlyCause object use is really the important part so I'm 
glad you found that wasn't being used, it explains a lot of ugly and not so 
helpful messages.

> Fixed Service invocation error: (commit transaction failed) error messages to 
> include actual message
> ----------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-503
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-503
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: framework
>            Reporter: Si Chen
>         Attachments: ofbiz503.patch
>
>
> I guess this has been bugging me for a very long time, so I finally dug 
> through it today and fixed it so that sometimes when a SECA service fails, 
> all you get back is a
> Service invocation error: (commit transaction failed) 
> and now it can display the full error message like this:
> Error calling event: org.ofbiz.webapp.event.EventHandlerException: Service 
> invocation error (Roll back error, could not commit transaction, was rolled 
> back instead Service Error [postInvoiceToGl]: Cannot find posting GL account 
> for invoice item 
> [GenericEntity:InvoiceItem][amount,50000.0(java.lang.Double)][createdStamp,2006-11-28
>  14:19:15.065(java.sql.Timestamp)][createdTxStamp,2006-11-28 
> 14:19:12.55(java.sql.Timestamp)][description,BIG-1 
> Server(java.lang.String)][inventoryItemId,null()][invoiceId,10160(java.lang.String)][invoiceItemSeqId,01(java.lang.String)][invoiceItemTypeId,PINV_FXASTPRD_ITEM(java.lang.String)][lastUpdatedStamp,2006-11-28
>  14:19:15.065(java.sql.Timestamp)][lastUpdatedTxStamp,2006-11-28 
> 14:19:12.55(java.sql.Timestamp)][overrideGlAccountId,null()][parentInvoiceId,null()][parentInvoiceItemSeqId,null()][productFeatureId,null()][productId,SERVER1(java.lang.String)][quantity,1.0(java.lang.Double)][taxAuthGeoId,null()][taxAuthPartyId,null()][taxAuthorityRateSeqId,null()][taxableFlag,null()][uomId,null()]
>  (null))
> The problem it turns out is that TransactionUtil sets a rollback and then 
> sets a RollbackOnlyCause in the setRollbackOnlyCause ThreadLocal variable, 
> then when the commit tries to rollback, it was not checking for this 
> RollbackOnlyCause.  I added some code to check if this existed and if so, get 
> the error message from it, and now it works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to