Hello,
I've been binding both transient and persistante
object so far succesfully. However we encountered
situation when only binding persistante objects work.
What is very strange about the situation is that
depending on data used to populate the object the same
query works ok or not at all with transient bindings.
Here goes the query itself:
SELECT d FROM DatedPrice d WHERE d.part = $1 AND
d.effectiveDate < $2 AND d.endDate > $2
(part being reference attribute, endDate is nullable)
here is simplified mapping:
<class name="Part"
identity="uniqueId"
key-generator="HIGH/LOW">
<description>Parts</description>
<map-to table="Parts"/>
<field name="uniqueId" type="integer" >
<sql name="Key" type="integer"/>
</field>
</class>
<class name="DatedPrice"
identity="uniqueId"
key-generator="HIGH/LOW">
<description>Prices</description>
<map-to table="Prices"/>
<field name="uniqueId" type="integer" >
<sql name="Key" type="integer"/>
</field>
<field name="price" type="double">
<sql name="value" type="double"/>
</field>
<field name="partImpl" type="Part">
<sql name="Part"/>
</field>
<field name="effectiveDate" type="date">
<sql name="EffectiveDate" type="date"/>
</field>
<field name="endDate" type="date">
<sql name="EndDate" type="date"/>
</field>
</class>
the query works fine with transient objects only when
endDate is null. Bizzare?
The error I'm getting is:
java.lang.IllegalArgumentException: object cannot be
null
at
org.exolab.castor.persist.TransactionContext.addObjectEntry(TransactionContext.java:1929)
at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:574)
at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:486)
at
org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:749)
at
org.exolab.castor.persist.LockEngine.load(LockEngine.java:359)
at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:575)
at
org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229)
at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:574)
at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImpl.java:557)
with the following printed on System.err:
java.lang.IllegalStateException: Transaction
org.exolab.castor.jdo.engine.TransactionContextImpl@2e1f1f
does not hold the read lock:
com.ford.fleet.pm.domain.impl.DatedPriceImpl/11255/1
-/-!
at
org.exolab.castor.persist.LockEngine$TypeInfo.assure(LockEngine.java:1178)
at
org.exolab.castor.persist.LockEngine$TypeInfo.access$3(LockEngine.java:1170)
at
org.exolab.castor.persist.LockEngine.revertObject(LockEngine.java:859)
at
org.exolab.castor.persist.TransactionContext.rollback(TransactionContext.java:1623)
at
org.exolab.castor.jdo.engine.DatabaseImpl.close(DatabaseImpl.java:241)
at
org.exolab.castor.jdo.engine.DatabaseImpl.finalize(DatabaseImpl.java:454)
at
java.lang.ref.Finalizer.invokeFinalizeMethod(Native
Method)
Any help?
Thanks, Krzysztof
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev