Hi,
JIRA raised and attached the patch as well.
https://issues.apache.org/jira/browse/ODE-958
regards,
sathwik
On Monday 19 March 2012 01:06 PM, Sathwik wrote:
Hi,
I came across this problem while using the Intalio server. I think
this problem exists in ODE as well.
Though I don't how to test this with a testcase, any idea?
Steps to reproduce:
1) Deploy a process to the server (V1)
2) Deploy the process again (V2)
3) V1: Retired and V2: Active
4) Now activate (Process package) V1 which is in Retired state.
5) An exception is thrown ContextException("Can't activate two
processes of the same name:....)
6) Now check the status of V1 and V2, you can see that both the
versions V1 and V2 are Active.
Upon Analysis of the code this is what I found:
org.apache.ode.store.ProcessStoreImpl.setState(QName, ProcessState)
a) Update the state of the process in database (this call runs in a
transaction and gets committed upon success)
b) Fire state change event
The event fired in (b) is handled in
org.apache.ode.axis2.ODEServer.handleEvent(ProcessStoreEvent) which
then lands up in the below method
org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelProcess). The
below code snippet finally creates the exception.
if (cachedVersion.getConf().getState() == ProcessState.ACTIVE
&& process.getConf().getState() == ProcessState.ACTIVE
&& !OdeGlobalConfig.autoRetireProcess()) {
throw new ContextException("Can't activate two processes of the
same name: " + process.getConf().getPackage() + ", " +
cachedVersion.getConf().getPackage() + ", name: " +
process.getProcessType());
}
The problem is now since in (a) the state is already updated and
committed and (b) is throwing an runtime exception, but this has no
effect and hence the stated problem.
regards,
sathwik