You should instead try storing it onValidate. If it fails, you should
record an error and if it succeeds you should commit only in onSuccess
(but the method body can be otherwise empty).

Kalle


On Thu, Sep 10, 2009 at 2:55 PM, Bruno Santos <bitbet...@gmail.com> wrote:
> Good evening,
>
> I have a form using a zone and i have @CommitAfter on the
> onSubmitFromEntityForm()
>
> <t:form t:id="entityForm" zone="entityZone">
> <input type="text" t:type="textfield" t:id="name"
>                                        t:value="entity.name" />
> </t:form>
>
> @CommitAfter
> Object onSubmitFromEntityForm() {
>  ....
> try {
> entityDao.persist(entity);
> } catch (exception ex) {
>  // handle exception
> }
> }
>
> altough i'm handling the exception the @CommitAfter creates a new
> exception since it tries to commit something that's not in transaction
> due to catched exception.
>
> How to deal with this? Is there a way to avoid the @CommitAfter to
> execute ... a handler i can use? I think i can remove the @CommitAfter
> but don't believe this should be first option.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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

Reply via email to