On Monday, April 23, 2012 4:21:50 PM UTC+2, Thomas Broyer wrote:
>
> You can use a custom JSR303 validator that does the select and the check; 
> so that in case of a unique constraint violation, a ConstraintViolation 
> would be sent back to the client (and in this case, the proxy is unfrozen 
> so it can be "fixed" before firing the RequestContext again).
>

Interesting. I'll look into it.
Do you realize, though, that by doing this you will:
- Make at least one DB access more than what's strictly necessary. 
- Potentially run concurrence risks. If the risks are considerable, you may 
need pessimistic locks...

I feel uneasy with the potential overheads you add just due to the 
architecture. But, well, I guess until issue #5794 is not included, and if 
such overheads are not a big issue (and I bet they won't be for most 
people), that's probably the way to go.

 

> When your service method has "error paths", yes; but the main idea is that 
> there should as few as possible.
>


If you manage to filter everything via validators, then yeah, probably you 
won't have much more error paths to deal with. I wasn't using validators 
for anything needing DB access though.


Thank you again for your answers Thomas. Your help is much appreciated.


Best regards,
Tiago.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/gBETWuHuMRAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to