[JBoss jBPM] - Re: JBPM - concurrent process execution fails
by estaub
"kukeltje" wrote : Ed,
|
| Will putting an async=true on the node realy force a commit? That has to be documented well then (rollback
| 's further on in the process a rollback will not be possible then) This is not a problem if the process has to wait for the return value of the async message node.
|
Ronald,
Take a look at Node.enter():
anonymous wrote : // execute the node
| if (isAsync) {
| ExecuteNodeJob job = createAsyncContinuationJob(token);
| MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
| messageService.send(job);
| token.lock(job.toString());
| } else {
| execute(executionContext);
| }
|
|
So yeah, I think it leads to a commit.
Unfortunately, as efip10 found out, there's a race condition between the commit and the new job.
-Ed Staub
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064389#4064389
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064389
19Â years
[JBoss Seam] - Re: persist() / remove() at end of long running conversation
by fjalvingh
I seem to have the same problem. I'm running seam 2.0.0b1 with hibernate 3.2.3, hbem 3.3.1 in JPA mode without EJB (Tomcat native).
I have a method as follows:
| @Transactional(TransactionPropagationType.REQUIRED)
| @Begin(flushMode=FlushModeType.MANUAL)
| public String createNewTarget() {
| System.out.println("method entered (fm=manual we hope)");
| m_target = new Target();
| m_target.setTargetSourceList(new ArrayList<TargetSourceModule>());
|
| m_target.setKey("akey");
| m_target.setName("Name");
| System.out.println("method before persist()");
| m_daoBuilder.save(m_target);
| System.out.println("method after persist()");
| return "newtarget";
| }
|
and when this gets called Hibernate immediately inserts the record:
| 01:26:41,964 DEBUG [SeamPhaseListener] before phase: INVOKE_APPLICATION 5
| method entered (fm=manual we hope)
| method before persist()
| Hibernate: select nextval ('ab_target_sq')
| *** fix: shouldDelayetc=false, fm=AUTO, ria=true
| Hibernate: insert into ab_target (tgt_autoDiscover, tgt_key, tgt_name, tgt_repository_version, tgtid) values (?, ?, ?, ?, ?)
| method after persist()
| 01:27:03,786 DEBUG [Manager] Beginning long-running conversation
|
The ***fix line is displayed around the fix you proposed. As you can see flushmode is manual and requireimmediateresult is true.
I have debugged thru Seam and found one very odd thing though- the @Begin annotation seems to set the flushmode etc after the method is invoked, not before! It is done in ConversationInterceptor.aroundInvoke; the pertinent code is:
| Object result = invocation.proceed();
| beginConversationIfNecessary(method, result);
| endConversationIfNecessary(method, result);
| return result;
|
The call to "beginConversation" sets the flush mode, but after the deed has been done. I don't yet know if this is the cause of the problem but having the annotation "start" after the method call seems weird to me to say the least.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064388#4064388
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064388
19Â years