Skip to main content

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

Nevermind....

Setting @Column(nullable=true) fixed this.


On Fri, Apr 3, 2009 at 9:58 AM, Jason Kusnier <jason@xxxxxxxxxxx> wrote:
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