I had the same problem with you before, and now I found that if you set the
cache type to be "none", it then works fine.
What's the default cache type if not specified for the class?
I think it should be a bug, because when I don't use lazy loading, I can get
the correct relationship even I don't specify the cache type either.
Do you think so?
Thanks,
John W
----- Original Message -----
From: "Jan Hansen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 11, 2001 2:35 AM
Subject: [castor-dev] Trouble using lazy loading
> Bugs have recently been fixed in
> org.exolab.castor.persist.RelationCollection, but I am still seeing
strange
> behavior when using lazy loading and trying to query database immediately
> after adding an object.
>
> Sniplets below outlines the overall structure of my code.
>
> Calling Address.getByClientId() causes following exception:
>
> java.lang.RuntimeException: PersistenceException for lazy loaded object
> org.exolab.castor.jdo.PersistenceException: Identities can't be null!
>
> at
>
org.exolab.castor.persist.RelationCollection$IteratorImp.lazyLoad(RelationCo
llection.java:278)
>
> at
>
org.exolab.castor.persist.RelationCollection$IteratorImp.next(RelationCollec
tion.java:253)
>
> at java.util.ArrayList.addAll(ArrayList.java:423)
>
> at Address.getByClientId(Address.java:232)
>
> at test.TestAddress.test(TestAddress.java:36)
>
> at java.lang.reflect.Method.invoke(Native Method)
>
> at junit.framework.TestCase.runTest(TestCase.java:166)
>
> ...
>
> Any suggestions on what is wrong is greatly appreciated. Please let me
know
> if a full example is needed to investigate this further.
>
> Kind Regards,
> Jan Hansen
>
> -------------------
>
> Test:
> ...
> Client c = Client.add("TEST Client for address","Description");
> Address a =
>
Address.add(c.getId(),"address1","address2","address3","city","zip","state",
"country");
> Collection c = Address.getByClientId(c.getId());
> ...
>
>
>
> Class Client:
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev