Interesting anomaly with object relational mapping query language update semantics. Apparently, it's not too useful with versioned classes using optimistic concurrency.

Begin forwarded message:

From: Peter Krogh <[EMAIL PROTECTED]>
Date: January 16, 2006 6:51:52 AM PST
Subject: RE: [Issue 154] New - EJBQL: bulk UPDATE statement should not update version columns

I imagine the reason why this was removed from the spec is because of the row count.  How do you know if you should throw an optimistic lock exception since you don't know how many objects were modified?
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Craig L Russell
Sent: Friday, January 13, 2006 8:25 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [Issue 154] New - EJBQL: bulk UPDATE statement should not update version columns

Hi,

I'd suggest waiting to hear from the spec lead(s) before doing anything with this bug report. I understand that this is a spec bug.

Craig

On Jan 13, 2006, at 12:11 PM, Marina Vatkina wrote:

Hi Michael,

Isn't the spec requirement wrong? While it might be
tricky to update version column of all tables, if
bulk update doesn't do it, any parallel tx can override the changes.

thanks,
-marina

----- Original Message -----
Date: Friday, January 13, 2006 11:11 am
Subject: [Issue 154] New - EJBQL: bulk UPDATE statement should not update version columns

Issue #|154
Summary|EJBQL: bulk UPDATE statement should not
update version
| columns
Component|glassfish
Version|9.0pe
Platform|All
OS/Version|All
URL|
Status|NEW
Status whiteboard|
Keywords|
Resolution|
Issue type|TASK
Priority|P3
Subcomponent|entity-persistence
Assigned to|tware
Reported by|mb124283






------- Additional comments from [EMAIL PROTECTED] Fri Jan 13
19:11:47 +0000 2006 -------
The PFD version of the EJB3 persistence spec clarifies that an
EJBQL bulk UPDATE
statement does not update version columns.

Today the EJBQL query
UPDATE Customer c SET c.name = 'CHANGED'
is mapped to the following SQL:
UPDATE CMP3_CUSTOMER
SET NAME = 'CHANGED', CUST_VERSION = (CUST_VERSION + 1)

--------------------------------------------------------------------
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
P.S. A good JDO? O, Gasp!


Craig Russell

Architect, Sun Java Enterprise System http://java.sun.com/products/jdo

408 276-5638 mailto:[EMAIL PROTECTED]

P.S. A good JDO? O, Gasp!


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to