Vishal,

can you please open a new issue at http://jira.codehaus.org/browse/CASTOR, and 
I'll have a look at this your problem 
(once I am back from a trip to London on Nov 3rd, 2005).

Regards
Werner

On Wed, 26 Oct 2005 16:28:04 +0530, [EMAIL PROTECTED] wrote:

>
>Hi,
>
>I am trying to retrieve the record CounterVar (id=4, type=1) - see
>mapping file description below - in one transaction. In the same
>program, with a different transaction, I am trying to retrieve the
>record CounterVar (id=1, type=1) in the DbLocked mode. Note that in both
>cases the type field references the same record. This results in my
>second transaction getting LockNotGrantedException (writeLockTimeout).
>When I rollback both transactions and retry the retrieve (in the context
>of the same process), I observed that the call to QueryResults.size()
>returns 1, but the call to QueryResults.hasMore() returns false. On
>further investigation, I found that the call to hasMore() sees the
>following exception stack trace:
>
>org.exolab.castor.jdo.ObjectNotFoundException: The object of type
>CounterVar with identity 1 was not found in persistent storage
>        at
>org.exolab.castor.persist.LockEngine.load(LockEngine.java:385)
>        at
>org.exolab.castor.persist.TransactionContext.load(TransactionContext.jav
>a:651)
>        at
>org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229)
>        at
>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQuer
>yImpl.java:633)
>        at
>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQuer
>yImpl.java:614)
>        at TestWriteLockTimeout.main(TestWriteLockTimeout.java:84)
>
>In looking at the code, I see that LockEngine.load() is actually
>converting the exception ObjectDeletedWaitingForLockException into
>ObjectNotFoundException.
>
>I am guessing that this is happening because of the previous
>(unsuccessful) retrieve. Any idea how this can be fixed?
>
>Regards, Vishal.
>
>PS: I have test programs that simulate this problem. I can send it if
>someone is interested in looking at the problem.
>
>I have the following mapping in my test program:
><mapping>
>
>        <!-- Mapping for CounterType table -->
>        <class name="CounterType"
>                                identity="id" key-generator="IDENTITY">
>        <cache-type type="none" />
>        <map-to table="COUNTER_TYPE" />
>
>                <field name="id" type="integer" >
>                        <sql name="counter_type_id" type="integer"/>
>                </field>
>                <field name="description" type="string">
>                        <sql name="counter_type_desc" type="varchar" />
>                </field>
>
>        </class>
>
>        <!-- Mapping for CounterVar table -->
>        <class name="CounterVar"
>                                identity="id" key-generator="IDENTITY">
>        <cache-type type="none" />
>        <map-to table="COUNTER_VAR" />
>
>                <field name="id" type="integer" >
>                        <sql name="counter_var_id" type="integer"/>
>                </field>
>                <field name="number" type="integer" >
>                        <sql name="counter_var_number" type="integer"/>
>                </field>
>                <field name="type" type="CounterType">
>                        <sql name="counter_var_type" />
>                </field>
>        </class>
></mapping>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any attachments to 
>this message are intended
>for the exclusive use of the addressee(s) and may contain confidential or 
>privileged information. If
>you are not the intended recipient, please notify the sender at Wipro or 
>[EMAIL PROTECTED] immediately
>and destroy all copies of this message and any attachments.
>
>-------------------------------------------------
>If you wish to unsubscribe from this list, please 
>send an empty message to the following address:
>
>[EMAIL PROTECTED]
>-------------------------------------------------
>





-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to