I have been using the pattern of EJB Stateless beans for the business layer.
In that business layer, I will persist to whatever datastore I need, and make my calls to jBPM as well.
The EJB Stateless Session Bean methods are wrapped with Container Managed transactions or Bean Managed transactions.
That way, when I make some update in my business layer, and transition jBPM, I know that if the jBPM call fails, or the call to my datastore, everything is rolled back.
Else, everything is committed.
Another option would be to write your own hibernate layer and then pass in the hibernate session. See: 7.1.4. Injecting the hibernate session for more on this.
Hi Brad, thanks for your reply. I'm looking into EJB 3 now as well as Seam.