To me, JSF is purely meant to create interfaces for the user. Any
business logic should reside in a separate component layer.
Not sure where anything i said contradicts that. I just want a way to re-submit a request. when a certain type of exception occurs The best way to do this is to re-submit failed requests at the highest level of the call stack.
There are multiple problems with the idea of just putting the retry in the business logic method
1) A single http request might require multiple business object requests. Having the full request be a conceptual transaction makes sense.
2) I would have to write separate retry logic (or maybe use some byte code injection) for every one of my methods
3) What if this is a remote object and it is unreachable...shouldn't I still be able to retry (this would allow for transparent fail-over)
4) When using ORM mappers like hibernate, it's natural to first fetch the objects and then call business object methods on them. When the transaction fails, I would need to do the fetch again. Yes, all my methods could take primary keys instead of objects and load them up but that is ugly.
I don't really understand the resistance here. There isn't a way to say, try this JSF request again?
| Richard Wallace <[EMAIL PROTECTED]>
08/08/2005 02:52 PM
|
|
I think the point that he was trying to make was that this isn't
something that JSF is meant to handle. The way I would handle something
like this is to have my backing bean get a reference to some business
logic object (living in Spring or some other container in the same JVM
or on another machine) and have the business logic object make the
multiple attempts to perform the transaction.
To me, JSF is purely meant to create interfaces for the user. Any
business logic should reside in a separate component layer.
Just my 2 cents,
Rich
[EMAIL PROTECTED] wrote:
>
> Just to be clear this is *not *a jdbc/orm issue. I can retry a request
> if I'm not using jsf. For example, I have an xml servlet layer which
> works fine with a filter that retries. Furthermore, there could be
> cases where a non-database issue requires a retry (maybe a network
> issue with a remote resource).
>
> Does anyone have any ideas how to retry a request in jsf?
>
>
>
> [EMAIL PROTECTED]
>
> 08/08/2005 01:58 PM
> Please respond to
> "MyFaces Discussion" <[email protected]>
>
>
>
> To
> "MyFaces Discussion" <[email protected]>
> cc
>
> Subject
> Re: Automatically retrying failed transactions
>
>
>
>
>
>
>
>
>
>
> This is more of a JDBC/ORM issue.
>
> You need a fishing pole to get the fish to your boat, you need a
> skillet to get the fish to the dinner table. There are tools to catch
> and cook the fish, but not in Java land ;)
>
> Dennis Byrne

