Well unfortunately the isolation level of the transaction hides database changes performed by other transactions so it won't know until commit if there will be a unique constraint error. Fortunately I think we don't have that many inserts so we can probably be fairly sure that what the transaction sees when it starts isn't changed by any other transaction.
[Message sent by forum member 'woel' (woel)]
http://forums.java.net/jive/thread.jspa?messageID=329689