On Thu, Feb 17, 2011 at 11:24, Igor Drobiazko <[email protected]>wrote:

> On Wed, Feb 16, 2011 at 7:39 PM, Josh Canfield <[email protected]
> >wrote:
>
> >
> >
> > How are you going to deal with failures when doing a multi-unit commit?
> >
> >
> This is the big question. As EntityTransaction doesn't support 2-phase
> commit, you can have a corrupt state in case of failures when doing a
> multi-unit commit.
>
>
> Here is for example what Seam doc says:
>
> ------------
> You should avoid EntityTransaction if you have more than one persistence
> unit in your application. Seam does not support installing multiple
> EntityTransaction beans, and the EntityTransaction interface does not
> support two phase commit, so unless you are careful you may have data
> consistency issues. If you need multiple persistence units in your
> application then we highly recommend using an EE 6 compatible server, such
> as Jboss 6.
> -------------
>
> So may be we should forbid multi-unit commits in the same request? If
> @CommitAfter is placed and there are more than one active transactions, we
> can throw an exception.
>

I think we should still add optional PUName to @CommitAfter for the case
when we have multiple active transactions,
but only want to commit one.

Also, how do you plan to start transactions? I found tapestry-jpa doesn't do
this efficiently.
(see "Make Tapestry-JPA Lazy" section here:
http://dmitrygusev.blogspot.com/2010/09/gae-and-tapestry5-data-access-layer.html
).


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Reply via email to