Using Hibernate 2.1.1 and PostgreSQL 7.4, I'm trying to use the Criteria API to do a SELECT ... FOR UPDATE on a given table. If I include a
Code:
criteria.setLockMode(LockMode.UPGRADE);
I get the following Exception
Code:
132531 [tcpConnection-8080-2] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: 0A000
132531 [tcpConnection-8080-2] ERROR util.JDBCExceptionReporter - ERROR: DECLARE CURSOR ... FOR UPDATE is not supported
132531 [tcpConnection-8080-2] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: 0A000
132531 [tcpConnection-8080-2] ERROR util.JDBCExceptionReporter - ERROR: DECLARE CURSOR ... FOR UPDATE is not supported
However, if I remove the criteria.setLockMode() statement, life is good. I used p6spy to check the SQL generated when the setLockMode(LockMode.UPGRADE) is used and it looks fine. I copied it into a SquirrelSQL window and the SQL executes fine. The problem appears to occur after the response comes back.
Any thoughts?