persistence@glassfish.java.net

EJBQL bulk UPDATE statement should not update version columns

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Mon, 16 Jan 2006 15:32:30 +0100

Hi Linda, hi Mike,

the PFD version of the spec clarifies the behavior of an EJBQL bulk
UPDATE statement wrt. to version columns: "Bulk update maps directly to
a database update operation, bypassing optimistic locking checks. The
application must manually update the value of the version column, if
desired, and/or manually validate the value of the version column."

I'm wondering why the bulk UPDATE does not update the version column,
because then these changes get lost if a parallel transaction modifies
the same instances. W/o updating the version column none of the
transactions is able to detect the conflict. Could you please give some
details about the rationale?

Thanks!

Regards Michael