[seam-dev] Seam/jBPM integration within the SOA platform

Kevin Conner kconner at redhat.com
Wed May 6 10:08:53 EDT 2009


A few weeks back I was investigating a problem for a customer, related
to the integration of seam applications within the SOA platform.  I
managed to chase down the issues but wanted to discuss them further in
this forum.  Apologies to Pete and Marek for taking so long over this.

First the relevant configuration

Within the SOA platform we have a jBPM/hibernate configuration that
results in the use of the hibernate JTASessionContext to manage the
lifecycle of sessions, tying those sessions into the encompassing JTA
transaction.  We are also using the jBPM JtaDbPersistenceService in
order to guarantee the existence of a transactional context for the jBPM
context.

The codebase I have used in this investigation is from the following tag

https://svn.jboss.org/repos/seam/branches/enterprise/JBPAPP_4_3_FP01

When running a seam example on the SOA platform we were seeing an
exception being thrown as a result of a hibernate session being used
after it has previously been closed, this was a SessionException with
the text "Session is closed!".

In chasing this down I discovered two issues
- an interleaving of the transaction synchronizations between jBPM
  and hibernate (now removed in jBPM, certainly in 3.2.5-SP5).  This
  could cause the session to be closed twice, depending on which order
  the Synchronizations were invoked by the transaction manager.
- hibernate objects being used outside of a transactional context

It is the latter that I would like to understand further as I was
surprised to see this given that some areas in the seam/jBPM integration
explicitly test for the existence of transactions and even create a
transactional context.  Is there a reason why this is not completely
done within a transaction?

I appreciate that I am a seam novice and there may be something obvious
that I am missing.  I do have some suggestions for a fix, however, and
would like some feedback as to whether they would be appropriate.  I
have attached the diff file to this message, again based on the previous
tag.

Thanks in advance for any help that you can give,
	Kev

-- 
JBoss, a Division of Red Hat
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire,
SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA), Matt Parsons
(USA) and Brendan Lane (Ireland)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: seam.diffs
Url: http://lists.jboss.org/pipermail/seam-dev/attachments/20090506/bf7ba572/attachment.pl 


More information about the seam-dev mailing list