You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Everton Agner <ev...@yahoo.com.br> on 2010/01/11 14:26:17 UTC

How to handle @CommitAfter failure?

Hi,

There is any way I can do that? I have some triggers on the database that can create errors on the Commit... So, there is a way I can write some method or something like that to handle this?

My goal is to reopen the window with some message based on the database error.

Thanks,

Everton



      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: How to handle @CommitAfter failure?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 11 Jan 2010 20:58:48 -0200, Howard Lewis Ship <hl...@gmail.com>  
escreveu:

> Though to be honest, you should probable not use @CommitAfter, but
> inject the HibernateSessionManager service directly, and invoke
> commit() on it, with your own try ... finally.

I still haven't given up to my dream of implementing a  
tapestry-transaction package that tapestry-hibernate, tapestry-jpa and etc  
could be integrated with. ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to handle @CommitAfter failure?

Posted by Massimo Lusetti <ml...@gmail.com>.
On Mon, Jan 11, 2010 at 11:58 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> Though to be honest, you should probable not use @CommitAfter, but
> inject the HibernateSessionManager service directly, and invoke
> commit() on it, with your own try ... finally.

And never use it on onSuccess...

Cheers
-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to handle @CommitAfter failure?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Though to be honest, you should probable not use @CommitAfter, but
inject the HibernateSessionManager service directly, and invoke
commit() on it, with your own try ... finally.

On Mon, Jan 11, 2010 at 5:46 AM, Everton Agner
<ev...@yahoo.com.br> wrote:
> Oh... I didn't know I could do that... Thanks.
>
>
>
>
> ________________________________
> De: Thiago H. de Paula Figueiredo <th...@gmail.com>
> Para: Tapestry users <us...@tapestry.apache.org>
> Enviadas: Segunda-feira, 11 de Janeiro de 2010 11:35:55
> Assunto: Re: How to handle @CommitAfter failure?
>
> Em Mon, 11 Jan 2010 11:26:17 -0200, Everton Agner <ev...@yahoo.com.br> escreveu:
>
>> Hi,
>
> Hi!
>
>> There is any way I can do that? I have some triggers on the database that can create errors on the Commit... So, there is a way I can write some method or something like that to handle this?
>
> Have you tried adding an onException(Throwable exception) in your page?
>
> --Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Res: How to handle @CommitAfter failure?

Posted by Everton Agner <ev...@yahoo.com.br>.
Oh... I didn't know I could do that... Thanks.




________________________________
De: Thiago H. de Paula Figueiredo <th...@gmail.com>
Para: Tapestry users <us...@tapestry.apache.org>
Enviadas: Segunda-feira, 11 de Janeiro de 2010 11:35:55
Assunto: Re: How to handle @CommitAfter failure?

Em Mon, 11 Jan 2010 11:26:17 -0200, Everton Agner <ev...@yahoo.com.br> escreveu:

> Hi,

Hi!

> There is any way I can do that? I have some triggers on the database that can create errors on the Commit... So, there is a way I can write some method or something like that to handle this?

Have you tried adding an onException(Throwable exception) in your page?

--Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: How to handle @CommitAfter failure?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 11 Jan 2010 11:26:17 -0200, Everton Agner  
<ev...@yahoo.com.br> escreveu:

> Hi,

Hi!

> There is any way I can do that? I have some triggers on the database  
> that can create errors on the Commit... So, there is a way I can write  
> some method or something like that to handle this?

Have you tried adding an onException(Throwable exception) in your page?

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org