Michael,

Thanks a lot for debugging this through! I think I've found the problem. The
message exchange was being reused between transactions. As it's backed by a
persistent object, changes in the second transaction were just ignored. This
monkey business was working with Hibernate but doesn't with OpenJPA. So I've
changed it to reload the message exchange properly, it should now work.

If you can give it a try and tell me how it goes, that would be super!

Thanks,
Matthieu

On 5/2/07, Michael Kammholz <[EMAIL PROTECTED]> wrote:

Hi Matthieu,

here some - hopefully - new findings:

First - you're totally right, the code indicated in my last mail is only
called at the end of the BPEL-process, so it has nothing to do with this
error.
The problem is indeed between setting the state to RESPONSE in
MessageExchangeImpl.setResponse() and getting this value in
BpelRuntimeContextImpl.invocationResponse2(), because when asking for the
MessageExchangeDAO in invocationResponse2() the EntityManager cannot find
the current Object where _status is set to RESPONSE and creates a new
Instance where _status is ASYNC. Here is the stack trace when the state is
reset to ASYNC:

Thread [pool-4-thread-2] (Suspended (modification of field _status in
MessageExchangeDAOImpl))
        MessageExchangeDAOImpl.pcClearFields() line: not available
        MessageExchangeDAOImpl.pcNewInstance(StateManager, Object,
boolean) line:
not available
        PCRegistry.newInstance(Class, StateManager, Object, boolean) line:
118
        StateManagerImpl.initialize(Class, PCState) line: 247
        JDBCStoreManager.initializeState(OpenJPAStateManager, PCState,
JDBCFetchConfiguration, ConnectionInfo) line: 327
        JDBCStoreManager.initialize(OpenJPAStateManager, PCState,
FetchConfiguration, Object) line: 252

        ROPStoreManager(DelegatingStoreManager).initialize(OpenJPAStateManager,
PCState, FetchConfiguration, Object) line: 108
        ROPStoreManager.initialize(OpenJPAStateManager, PCState,
FetchConfiguration, Object) line: 54
        FinalizingBrokerImpl(BrokerImpl).initialize(StateManagerImpl,
boolean,
FetchConfiguration, Object) line: 873
        FinalizingBrokerImpl(BrokerImpl).find(Object, FetchConfiguration,
BitSet,
Object, int, FindCallbacks) line: 831
        FinalizingBrokerImpl(BrokerImpl).find(Object, boolean,
FindCallbacks)
line: 748
        DelegatingBroker.find(Object, boolean, FindCallbacks) line: 169
        EntityManagerImpl.find(Class<T>, Object) line: 346
        BPELDAOConnectionImpl.getMessageExchange(String) line: 155
        BpelRuntimeContextImpl.invocationResponse2(String,
InvokeResponseChannel)
line: 953
        BpelRuntimeContextImpl.access$000(BpelRuntimeContextImpl, String,
InvokeResponseChannel) line: 89
        BpelRuntimeContextImpl$4.run() line: 939
        GeneratedMethodAccessor19.invoke(Object, Object[]) line: not
available
        DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
        Method.invoke(Object, Object...) line: 585
        JacobVPU$JacobThreadImpl.run() line: 451
        JacobVPU.execute() line: 139
        BpelRuntimeContextImpl.execute() line: 817
        BpelProcess.handleWorkEvent(Map<String,Object>) line: 310
        BpelEngineImpl.onScheduledJob(Scheduler$JobInfo) line: 311
        BpelServerImpl.onScheduledJob(Scheduler$JobInfo) line: 384
        QuartzSchedulerImpl.doExecute(Scheduler$JobInfo) line: 351
        QuartzSchedulerImpl.execute(JobExecutionContext) line: 367
        JobImpl.execute(JobExecutionContext) line: 32
        JTAJobRunShell(JobRunShell).run() line: 203
        ThreadPoolExecutor$Worker.runTask(Runnable) line: 650
        ThreadPoolExecutor$Worker.run() line: 675
        Thread.run() line: 595

So maybe there is a transaction not committed after setting state to
RESPONSE or anything else to trigger the persistance layer?

Hope that helps a bit.
Also I've attachted the console output of ODE in debug mode for further
information.

Best,
Michael

--
Michael Kammholz
Arlanis Software AG
Kurfürstenstr. 15
14467 Potsdam

http://www.arlanis.com
Phone:  +49 331 27911-29
Fax:    +49 331 27911-1
[EMAIL PROTECTED]:  [EMAIL PROTECTED]

Amtsgericht Potsdam: HRB 19134 P
Steuer Nr.: 046 100 01292
Vorstand: Christian Metzger

Reply via email to