[seam-dev] persistence module page drafted

Dan Allen dan.j.allen at gmail.com
Wed Apr 14 15:00:57 EDT 2010


On Wed, Apr 14, 2010 at 2:25 PM, Pete Muir <pmuir at redhat.com> wrote:

>
> On 14 Apr 2010, at 19:21, Dan Allen wrote:
>
> > On Wed, Apr 14, 2010 at 9:13 AM, Pete Muir <pmuir at redhat.com> wrote:
> > I'm with Emmanuel here.
> >
> > All of this is addressable through an Transactions utiltiy class.
> >
> > Let me ask for two clarifications that will help me understand the
> counter argument.
> >
> > 1. If this transaction wrapper extends UserTransaction, is that
> worse/different than having a utility class? You can always inject the
> native type, or inject the wrapper for the extra convenient status methods.
> > 2. The transaction wrapper allows us reuse the UserTransaction API to
> address JTA, resource-local and potentially spring transaction APIs as one.
> The client then doesn't concern itself with which transaction API is being
> used under the covers, but everyone "speaks" JTA UserTransaction. How do we
> do that with just a utility class?
>
> What interface does the client reference in their code?
>
> I think you are confusing two concepts.


By "client", I am referring to other modules (and in rarer cases the
developer's application). A use case would probably help here.

The Faces module needs to provide the Seam-managed transactions that tie
into the JSF lifecycle. (Let's call them "lifecycle transactions" rather
than the term "global", which I have used in the past). That integration
needs to get a handle on the transaction API. We don't want to tie ourselves
to the native JTA UserTransaction or else we put environments without JTA
out in the cold (e.g., servlet containers).

What I am proposing a producer method that grabs the transaction of choice
(defaulting to JTA if it's available), wraps it inside of an object that
implements JTA UserTransaction with some extra convenience methods (the
status and enlist methods we previously discussed), and returns it. The
Faces module can then use this extended UserTransaction to interact with
whatever transaction API is being used under the covers.

This model worked well for us in Seam 2. I'm trying to understand why we
are rescinding on our past decisions.

-Dan

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/seam-dev/attachments/20100414/a8fa8d14/attachment-0001.html 


More information about the seam-dev mailing list