[ 
https://issues.jboss.org/browse/JBSEAM-4512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583040#comment-12583040
 ] 

Stefano Zaccaria commented on JBSEAM-4512:
------------------------------------------

Hello Marek,
thanks for your fast reply. In this moment I'm investigating about this 
problem. I've try this code in a ActionHandler Class, but until now I not have 
the roolback work in both session ( session from seam and session from jbpm )...

{code:title=TestActionHandler.java|borderStyle=solid}
public class TestActionHandler implements ActionHandler {
        
        private static final long serialVersionUID = 1L;

        public void execute(ExecutionContext executionContext) throws Exception 
{
                                
                Log log = Logging.getLog(ControlloDocumento.class);
                                
                Session sessionjbpm = 
executionContext.getJbpmContext().getSession();
                Session session = (Session)Component.getInstance("session");
                
                log.info("Session take from jbpm   : #0", 
sessionjbpm.hashCode());
                log.info("Sessione take from seam: #0", session.hashCode());
                
                Document doc = (Document)session.get(Document.class, 23l);
                doc.setMessage("Write some data for test rollback... " );
                
                throw new RuntimeException("Throw some exception for test"); 
                
                // After the previous code the "message" property of doc entity 
save the modify and not do the rollback !!!             
        }
}
{code}

Some idea to fix ?
Can help me? If you have time can contact you directly... I'm frustrated and 
shot down :( 

> BPM task does not rollback
> --------------------------
>
>                 Key: JBSEAM-4512
>                 URL: https://issues.jboss.org/browse/JBSEAM-4512
>             Project: Seam
>          Issue Type: Bug
>          Components: BPM
>    Affects Versions: 2.2.0.CR1, 2.2.0.GA, 2.2.1.CR2
>         Environment: Testing this on Windows XP.  Deploying to JBoss AS 4.2.2
>            Reporter: Jason E
>            Assignee: Marek Novotny
>             Fix For: 2.3.0.ALPHA
>
>
> I have made a simple change to the ShipAction.java class in the dvdstore 
> example that ships with Seam. Here is the change
> //@EndTask
> public String ship() {
>     order.ship(track);
>     TaskInstance ti = 
> ManagedJbpmContext.instance().getTaskInstance(taskInstance.getId());
>     taskInstance.end();
>     if(true) throw new RuntimeException("TESTING");
>     return "admin";
> }
> I commented out the end task annotation and I am ending the task via the 
> TaskInstance API. When I throw the Runtime exception the changes to the 
> ORDERS entity bean (i.e. updating the tracking number) rolls back. The 
> problem is that the task instance change (i.e. ending the task) does not 
> rollback. It appears that jBPM is flushing its changes in another db 
> transaction.  This seems like a bug since I would expect the ending of my 
> task to also rollback.  This seems like the desired behavior.
> This was the only change I made to the dvdstore example that ships with Seam 
> 2.2.0.GA so it should be easy to reproduce.
> Thanks!
> Jason

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to