Hibernate version: 1.2.0 alpha1
SQL Server 2005
When using optimistic concurrency on a class / table that contains NTEXT / TEXT columns, NHibernate generates an invalid SQL statement, as follows:
UPDATE MYTABLE SET COL1 = ?, MYNTEXT = ? WHERE ID = ? AND COL1 = ? AND MYNTEXT = ?
It fails as MYNTEXT is an NTEXT column, an this type of large-object cannot be compared with the equals operator - only supports IS [NOT] NULL.
I suspect a work around is to create a one-to-one child class mapping to the same table, that contains just the large-object column and set optimistic-concurrency to either none or version.
Hibernate supports optimistic-lock="false" at the property level - is this something we can back-port? I will be happy to do this and submit a patch.
Cheers,
Stu
_________________ --
Stuart Carnie
|