Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] @OptimisticLocking(type=OptimisticLockingType.CHANGED_COLUMNS) invalid UPDATE when changing from null

I'm getting an OptimisticLockException when I update a column from null to any value.

It appears that the update statement that is generated is invalid:

It generates:
UPDATE prov.dcs_vt SET order_number = ? WHERE ((dcs_vt_id = ?) AND (order_number = ?))
bind => [ABC, 1234, null]

This won't work since the valid syntax in this case should be:
UPDATE prov.dcs_vt SET order_number = ? WHERE ((dcs_vt_id = ?) AND (order_number is ?))
bind => [ABC, 1234, null]


Is there a way around this?

Back to the top