|
Teradata database requires that locks must be prepended rather than appended to SQL. This works most of the time because the Dialect method applyLocksToSql() is overridden to provide this behavior. There are two places where the locks are simply appended that cause failures on Teradata. These occur in: org.hibernate.loader.plan.exec.query.internal.SelectStatementBuilder.java org.hibernate.sql.SimpleSelect
both of which call: buf.append( dialect.getForUpdateString( lockOptions ) );
Example of locking SQL: H2: select a0_.id from T_LOCK_A a0_ where a0_.id=? Locking row for write Teradata: Locking row for write select a0_.id from T_LOCK_A a0_ where a0_.id=?
org.hibernate.test.locking.LockModeTest.java can be used to demonstrate the problem and validate the fix
|