All the persistence frameworks in AppFuse allow a entity to be
"detached" and then re-attached later. Transactions are demarcated at
the service layer - so they're already detached (in a sense) when you
edit them in a form. You should be able to stuff the entity in the
session, operate it on it over a page or 2 and then save it again. As
long as the primary key is carried through, an update should occur
instead of an insert. If that doesn't work, I'd look at SWF. It might
be overkill, but it is powerful and it's a tool worth having in your
tool belt.

Matt

On 2/10/08, Christophe Thiebaud <[EMAIL PROTECTED]> wrote:
> That's close to what I meant. I was investigating Spring WebFlow that I
> see is an alternative to MyFaces Orchestra. But although I am sure these
> tools have the solution to my problem, I feel that they are overkill.
>
> Sorry, but my understanding of the spring/jpa/transactions usage in
> general and in AppFuse in particular is not very good.
>
> I guess my problem boils down to:
> If I fetch an entity from the DB during the processing of a request, how
> can I re-use this entity in subsequent requests ? Can I merely store it
> as a session attribute ? But isn't this entity bound to a persistence
> context that lives only within a transaction, so within a request ? So
> after reading the jpa doc it looks that I need an extended persistence
> context that lives across transactions. But I have no clue on how
> implementing that in AppFuse. Or maybe it is the default case in AppFuse
> ?
>
> thanks
> Christophe
>
>
> -----Original Message-----
> From: Matt Raible [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 11, 2008 2:00 AM
> To: [email protected]
> Subject: Re: [appfuse-user] Appfuse 2.01 + extended persistence context
>
> What do you mean by "extended persistence context" - do you have an
> example? Do you mean something like MyFaces Orchestra?
>
> http://myfaces.apache.org/orchestra/index.html
>
> Matt
>
> On 2/10/08, Christophe Thiebaud <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > We are happy users of AppFuse 2.0.1, struts2 + jpa flavor. BTW, thanks
>
> > Matt for the good work.
> >
> > I need to implement an extended persitence context.
> > I am lost in the wealth on general documentation on the subject.
> > I was not able to find in the appfuse user list any thread on this
> > subject.
> >
> > Can somebody gives us pointers decribing how to implement a jpa
> > extended persistence context in AppFuse.
> > (Ideally a sample application) ?
> >
> > thanks
> > Christophe
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to