Servcietask‘s Transaction Problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2013 05:00 AM
I use a Servicetask to complete some work.
but when the task takes too long time to end,there happened some exception:connection had been closed !
I found that because of transation,so i use a thread to finish the work
I write MyServiceServiceeTask extends TaskActivityBehavior ,such as
@Override
public void signal(ActivityExecution execution, String signalName,
Object signalData) throws Exception {
leave(execution);
}
@Override
public void execute(ActivityExecution execution) throws Exception {
//this is need
execution.getVariables();
Thread t = new AsynRunThread(execution);
t.start();
}
and at the end of thread,I call signal method to leave this task.
there some times happened that task finished but table act_hi_actinst's end_time_ is null
because Thread sometime finished before the Main class(MyServiceServiceeTask)'s transaction end
who encoutered this problem or give me some advices
but when the task takes too long time to end,there happened some exception:connection had been closed !
I found that because of transation,so i use a thread to finish the work
I write MyServiceServiceeTask extends TaskActivityBehavior ,such as
@Override
public void signal(ActivityExecution execution, String signalName,
Object signalData) throws Exception {
leave(execution);
}
@Override
public void execute(ActivityExecution execution) throws Exception {
//this is need
execution.getVariables();
Thread t = new AsynRunThread(execution);
t.start();
}
and at the end of thread,I call signal method to leave this task.
there some times happened that task finished but table act_hi_actinst's end_time_ is null
because Thread sometime finished before the Main class(MyServiceServiceeTask)'s transaction end
who encoutered this problem or give me some advices
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2013 04:05 AM
When you get an exception is this circumstances, it's due to your database closing the connecting because it has been open for too long. So you can change your database settings to allow a longer period of time for your connections. How much time are we talking about?
For the issue of the end time, can you create a unit test showing this issue?
Best regards,
For the issue of the end time, can you create a unit test showing this issue?
Best regards,
