probably optimistic locking in action
-----Original Message-----
From: Benjamin Voiturier [mailto:[EMAIL PROTECTED]]
Sent: 06 June 2002 16:59
To: [EMAIL PROTECTED]
Subject: [castor-dev] JDO's SQL UPDATE clause causing trouble...

Hi,

 

I'm using castor JDO and have a question about the way SQL UPDATE instructions for objects are build by castor...

For instance, I have the following Envelope object declared in the jdo xml mapping file:

 

<class name=" Envelope" access="shared" identity="envelopeID" key-generator="MAX">

<map-to table="Envelope" />

            <field name="envelopeID" type="long">

                        <sql name="envelopeID" type="integer" />

            </field>

            <field name="name" type="string">

                        <sql name="name" type="varchar" />

            </field>

            <field name="description" type="string">

                        <sql name="description" type="clob" />

            </field>

</class>

 

When activating JDO log writer, I see that the generated update SQL for this envelope object is:

UPDATE envelope set name=?, description=? WHERE envelopeID=? AND name=? AND description=?

 

I don't really understand why the WHERE clause uses all declared field of the class ?

In this case, envelopeID is enough to uniquely select the envelope row as envelopeID field is defined as the identity field.

Furthermore, the WHERE clause also filters on the declared clob/blob fields which is not supported with databases like Oracle for instance.

 

Does anybody have any clue about that ???

 

Thanks,

Benjamin.



**********************************************************************************

The opinions expressed in this E-mail are those of the individual and
not necessarily the company. This E-mail and any files transmitted
with it are confidential and solely for the use of the intended recipients

**********************************************************************************

Reply via email to