I should probably clarify, the exception gets thrown the first time, but the second update
appeared to succeed when in fact it silently dropped. I've done quite a bit of
rearranging now, and haven't reproduced the problem.
As for checking the unique constraint by hand before possibly violating it, I suppose I
can live with that, even if it violates DRY. The how of that however is still a bit
elusive -- checking it in the action method seems to come too late, because the model
values have already been updated, and I get dumped into the debug page due to constraint
violations while accessing other components -- namely a datamodel that lists related
entities, one of which might actually have the conflicting name.
I tried using a separate entityManager so I wouldn't be reading the current
transaction's dirty data, but that didn't pan out either -- the datamodel just
ended up null.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982466#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...