Login  Register

Transaction problem with ofbiz-workflow start (geronimo issue????)

Posted by David Garrett on Aug 08, 2006; 2:39am
URL: http://ofbiz.116.s1.nabble.com/XSD-schema-conversion-anyone-tp170452p170463.html

Hi,

I am trying to upgrade to a much more recent version of Ofbiz.

The problem I have is starting a workflow with the orignial ofbiz-workflow
(ie not trying to use Shark yet)

I was wondering whether the transaction problem related to the change to
geronimo TM.

I have a VERY simple workflow which is initiated with
WorkflowEngine.runAsync(..)

Any suggestions appreciated.

It fails on:
                beganTransaction = TransactionUtil.begin();

The code executed is very small ... In WorkflowEngine
    public void runAsync(String localName, ModelService modelService, Map
context, GenericRequester requester, boolean persist) throws
GenericServiceException {      
        // Suspend the current transaction
        TransactionManager tm = TransactionFactory.getTransactionManager();
        if (tm == null) {
            throw new GenericServiceException("Cannot get the transaction
manager; cannot run persisted services.");
        }

        Transaction parentTrans = null;
        boolean beganTransaction = false;
        try {
            try {
                parentTrans = tm.suspend();                
                beganTransaction = TransactionUtil.begin();  <======
EXCEPTION GENERATED HERE!!!!
                //Debug.logInfo("Suspended transaction; began new: " +
beganTransaction, module);
            } catch (SystemException se) {
                Debug.logError(se, "Cannot suspend transaction: " +
se.getMessage(), module);
            } catch (GenericTransactionException e) {
                Debug.logError(e, "Cannot begin nested transaction: " +
e.getMessage(), module);
            }


The exception is as follows:

2006-08-08 11:22:51,099 (http-0.0.0.0-8443-Processor3) [
ServiceDispatcher.java:468:DEBUG] [[ASync service started...-
total:0.0,since last(Begin):0.0]] - 'leadmgt / processWf'
2006-08-08 11:22:58,700 (http-0.0.0.0-8443-Processor3) [
TransactionUtil.java:530:WARN ]
---- exception report
----------------------------------------------------------
WARNING: In setTransactionBeginStack a stack placeholder was already in
place, here is where the transaction began:
Exception: java.lang.Exception
Message: Tx Stack Placeholder
---- stack trace
---------------------------------------------------------------
java.lang.Exception: Tx Stack Placeholder
org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack(Transa
ctionUtil.java:524)
org.ofbiz.entity.transaction.TransactionUtil.begin(TransactionUtil.java:111)
org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:498)
org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:620)
org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:181)
org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:188)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:2
90)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:407)
<+++.-.-.-.-.-.... Snip>
----------------------------------------------------------------------------
----

2006-08-08 11:22:58,700 (http-0.0.0.0-8443-Processor3) [
TransactionUtil.java:532:WARN ]
---- exception report
----------------------------------------------------------
WARNING: In setTransactionBeginStack a stack placeholder was already in
place, here is the current location:
Exception: java.lang.Exception
Message: Current Stack Trace
---- stack trace
---------------------------------------------------------------
java.lang.Exception: Current Stack Trace
org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack(Transa
ctionUtil.java:531)
org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack(Transa
ctionUtil.java:525)
org.ofbiz.entity.transaction.TransactionUtil.begin(TransactionUtil.java:111)
org.ofbiz.entity.transaction.TransactionUtil.begin(TransactionUtil.java:57)
org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:100)
org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:82)
org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:553)
org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:620)
org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:181)
org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:188)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:2
90)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:407)
<+++.-.-.-.-.-.... Snip>
----------------------------------------------------------------------------
----

2006-08-08 11:22:58,710 (http-0.0.0.0-8443-Processor3) [
WfProcessMgrImpl.java:97 :INFO ] [WfProcessMgr.init] : Create process
manager (org.ofbiz.leadmgt[null] / processWf[null])
2006-08-08 11:22:58,730 (http-0.0.0.0-8443-Processor3) [
ServiceDispatcher.java:564:DEBUG] [[ASync service failed...-
total:7.631,since last(ASync service sta...):7.631]] - 'leadmgt / processWf'
2006-08-08 11:22:58,730 (http-0.0.0.0-8443-Processor3) [
ServiceDispatcher.java:567:ERROR]
---- exception report
----------------------------------------------------------
Service [processWf] threw an unexpected exception/error
Exception: org.ofbiz.service.GenericServiceException
Message: Cannot resume transaction (Caller context is not an unspecified
transaction context)
---- stack trace
---------------------------------------------------------------
org.ofbiz.service.GenericServiceException: Cannot resume transaction (Caller
context is not an unspecified transaction context)
org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:281)
org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:82)
org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:553)
org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:620)
org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:181)