On May 27, 2010, at 4:41 PM, glassfish_at_javadesktop.org wrote:
> You can check for possible constraint violations in your code, then
> there will be no SQL exception at all (or in most cases). And your
> application might even work faster (exceptions are expensive).
Only with pessimistic locking, right? Otherwise, a different
transaction could commit a change before the constraint-violation-
checking transaction commits. I do what the original poster does --
let the DB tell me if there's an issue at the DB level.
Cheers,
Bobby