Re: [appfuse-user] ActionExceptionHandler

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [appfuse-user] ActionExceptionHandler

Matt Raible-3
If you want to control Spring's rollback logic for checked exceptions,
you'll need to modify your transaction attributes in
applicationContext-service.xml.

The default is to rollback on runtime exceptions only.  If you want to
rollback on checked exceptions, you'll need to add -ExceptionName, as
in the following example:

<prop key="save*">PROPAGATION_REQUIRED,-UserExistsException</prop>

If you want the transaction to commit regardless of a checked (or
runtime I believe) exception, you need to add +ExceptionName.

Hope this helps,

Matt

On 6/27/05, Rafael Nami <[hidden email]> wrote:

> Hi all
>  I had a behavior that gave me some nights without sleep, that was the
> problem about Exceptions in Struts, doesn't mantaining the Session-Scope
> values. I've restrained this behavior restraining User interaction with some
> fields, but I want to give to the users the flexibility to give the product
> id's without the search popup.
>  I think is something about Transaction stuff wired with aop, am I correct?
> (I've seen some code around in appfuse, don't remember where, that rollback
> transactions if Exceptions occurs). If I'm correct, how can I set some
> Exception to don't rollback everything?
>  And how can I setup "localized" Exception messages to my users?
>  OBS - I've setup Spring-webflow in appfuse-struts, but it didn't ring the
> bell yet. I'm thinking on write a tutorial/article/whatever comparing the
> two approaches, writing nail flows with pure Struts or using something like
> Spring Web Flow, when this Exception stuff is resolved.
>  
>  Best Regards
>  
>  Rafael Mauricio Nami
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [appfuse-user] ActionExceptionHandler

rafanami
Thanks Matt, that will resolve my "ghost session escape" bug :).

On 7/27/05, Matt Raible <[hidden email]> wrote:
If you want to control Spring's rollback logic for checked exceptions,
you'll need to modify your transaction attributes in
applicationContext-service.xml.

The default is to rollback on runtime exceptions only.  If you want to
rollback on checked exceptions, you'll need to add -ExceptionName, as
in the following example:

<prop key="save*">PROPAGATION_REQUIRED,-UserExistsException</prop>

If you want the transaction to commit regardless of a checked (or
runtime I believe) exception, you need to add +ExceptionName.

Hope this helps,

Matt

On 6/27/05, Rafael Nami <[hidden email]> wrote:

> Hi all
>  I had a behavior that gave me some nights without sleep, that was the
> problem about Exceptions in Struts, doesn't mantaining the Session-Scope
> values. I've restrained this behavior restraining User interaction with some
> fields, but I want to give to the users the flexibility to give the product
> id's without the search popup.
>  I think is something about Transaction stuff wired with aop, am I correct?
> (I've seen some code around in appfuse, don't remember where, that rollback
> transactions if Exceptions occurs). If I'm correct, how can I set some
> Exception to don't rollback everything?
>  And how can I setup "localized" Exception messages to my users?
>  OBS - I've setup Spring-webflow in appfuse-struts, but it didn't ring the
> bell yet. I'm thinking on write a tutorial/article/whatever comparing the
> two approaches, writing nail flows with pure Struts or using something like
> Spring Web Flow, when this Exception stuff is resolved.
>
>  Best Regards
>
>  Rafael Mauricio Nami
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]