I have the same situation after Hibernate update to 4.2.0 Final.
You can simple "solve" it by using an own derived dialect with:
Code:
@Override
public boolean useFollowOnLocking() {
return false;
}
It works fine for Oracle. But why it was implemented in Oracle8iDialect.java with return true?
I like the "select ... for update" statement, because I can save one JDBC call.
SQL-Logging with useFollowOnLocking=false
Code:
DEBUG 2013-03-19 14:57:48.124 [ consumer1] -
/* select
generatedAlias0
from
AcxSequence as generatedAlias0
where
generatedAlias0.name=:param0 */ select
acxsequenc0_.id as id1_3_,
...,
acxsequenc0_.maxvalue as maxvalu10_3_
from
AcxSequence acxsequenc0_
where
acxsequenc0_.name=? for update
[SQL]
SQL-Logging with useFollowOnLocking=true
Code:
DEBUG 2013-03-19 14:53:35.743 [ consumer2] -
/* select
generatedAlias0
from
AcxSequence as generatedAlias0
where
generatedAlias0.name=:param0 */ select
acxsequenc0_.id as id1_3_,
....,
acxsequenc0_.maxvalue as maxvalu10_3_
from
AcxSequence acxsequenc0_
where
acxsequenc0_.name=? [SQL]
DEBUG 2013-03-19 14:53:35.744 [ consumer2] -
/* PESSIMISTIC_WRITE lock com.ssn.acx.entity.core.sequence.AcxSequence */ select
id
from
AcxSequence
where
id =?
and version =? for update
[SQL]
Anybody who knows why the two statements are enforced in Oracle8iDialect.java?