cancel
Showing results for 
Search instead for 
Did you mean: 

parallel exceptionhandling

al_lv
Champ in-the-making
Champ in-the-making
Hi,

I created tow processes with exception handling as it described in example files(with tansitions).
[attachment=1]siebel.png[/attachment]
[attachment=2]email.png[/attachment]

Now i want to run them parallel. So I created call activity with these processes and connected them with paralle gateway.
[attachment=0]EmailAndArchive.png[/attachment]

Is it a correct way to do somthing like this?

every last of these processes works fine.
But together in the process with call-Activities I get this Error in TOmcat:

Caused by: java.sql.SQLException: Transaction (Process ID 65) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

Pleas help

I run Activiti 5.8 with MSSQL
May be the problem is because I use in User Task the same Class as in the serviceTask? So i implement tow interfaces: ActivityBehavior and TaskListener

Thanks

Alexej
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi,

The BPMN process definitions seem to be fine.
What kind of transaction handling are you using?
Is there something complex happening in the service tasks?

Best regards,

al_lv
Champ in-the-making
Champ in-the-making
What kind of transaction handling are you using?
I dont know. I didn't change anything by activiti.

Is there something complex happening in the service tasks?
actually not. I just call funtionality of our software. it archives document in CRM-siebel. this is my class:

public class SiebelTask extends C4ServiceTask{
private static final Logger LOG = LoggerFactory.make();
private Expression partnerSystem;

public void execute(ActivityExecution execution) throws Exception {
  PvmTransition transition = null;
  Map<String, Object> variables = new HashMap<String, Object>();

  String partnerSystemStr = (String) partnerSystem.getValue(execution);

  if (execution.hasVariables()) {
   try {
    LOG.info("Starting siebel task. ThreadID: "
      + Thread.currentThread().getId());

    variables = execution.getVariables();
   
    byte[] startupByte = (byte[]) variables.get("startup");
    String startupXml = new String(startupByte);

    Startup startup = new JaxbStartup(startupXml);
    ConnectorBusinessData data = loadDataXml(variables.get("data"));

    SiebelStartup siebelStartup = new SiebelStartup(startup);

    SiebelRunner sr = new SiebelRunner(siebelStartup,
      partnerSystemStr);

    Properties props = new Properties();

    CallbackProperties callbackProperties = new CallbackProperties();
    callbackProperties.setProperties(props);

    sr.execute(new BusinessServiceInvoker(data, callbackProperties
      .getProperties()));
   
    transition = execution.getActivity().findOutgoingTransition(
      "siebel-no-exception");
    LOG.info("Siebel task was succesfully completed. ThreadID: "
      + Thread.currentThread().getId());
   } catch (Exception e) {

    LOG.severe("ThreadID: " + Thread.currentThread().getId()
      + "\nEs gibt ein Problem bei siebel task: "
      + e.getMessage());
    transition = execution.getActivity().findOutgoingTransition(
      "siebel-exception");
   }
                     execution.take(transition);
  
  } else {
   LOG.severe("Es gibt folgendes Problem: Die Processvariablen konnten nicht gesetzt werden.");
  }

}

CServiceTask implements AcitvityBehavior