This content has been marked as final.
Show 1 reply
-
1. Re: Efficient concurrent insert and unique constraint
dcausse May 20, 2008 6:21 AM (in response to dcausse)I tried to find a word-around to my problem and found a deprecated way to access a JDBC connection with Session.connection(); and do my error checking there.
I've read that in the future a Worker API will be available via Session.doWork(Work w) and I could gain access to the current JDBC Connection object.
I've prepared my code to handle this but for now I still use the deprecated Session.connection().
My question is : can I rely on this? Will a catched SQLException thrown within a doWork() will rollback my current transaction?
If no, is there any design pattern to make a concurrent safe "find or create" entity with hibernate?
Thank you.