WARN org.hibernate.loader.Loader - HHH000444: Encountered request for locking however dialect reports that database prefers locking be done in a separate select (follow-on locking); results will be locked after initial query executes
Solution
This appears to happen with Oracle and the fix is to create a custom dialect as follows
import org.hibernate.dialect.Oracle10gDialect;
public class BatchOracleDialect extends Oracle10gDialect{
@Override
public boolean useFollowOnLocking() {
return false;
}
}
Now change your hibernate.cfg.xml as follows
<property name="hibernate.dialect"><<package>>.BatchOracleDialect</property>