I tested with RC5 CVS HEAD and the ClassCastException no longer happens.

-----Original Message-----
From: Frank Rub [mailto:[EMAIL PROTECTED] 
Sent: ter�a-feira, 17 de Fevereiro de 2004 19:22
To: [EMAIL PROTECTED]
Subject: proxy loading issue from rc4 -> rc5


Armin,

in the last hour, I made a checkout from CVS (ISDN rules! :-) ) and I did a
build.

with the latest CVS version, the problem does no more occur. Proxy Loading
works correct as in 1.0 rc4.

Thanks for your quick help!
best regards
Frank

> I have the same problem
> but this bug is not fix !!

 I try to write a test case for this problem without success, my test always
pass. I use latest from CVS.


> Hi, i am also having the same problem with rc5.


 -----Urspr�ngliche Nachricht-----
Von:    Frank Rub [mailto:[EMAIL PROTECTED]
Gesendet:       Dienstag, 17. Februar 2004 14:47
An:     '[EMAIL PROTECTED]'
Betreff:        proxy loading issue from rc4 -> rc5

Hi,

I think there's a wrong behaivour in 1.0 rc5.
(with 1.0 rc4 it works well)

I have an Object with holds a collection of other objects
the loading of the collection is realized wih "proxy=true"
The Class Descriptor is correct (it works with 1.0 rc4)

public class SecondObject
{
        int pkey;
        .....
}

public class FirstObject
{
        int pkey; ....
        Collection manySecondObjects;
}

If I do the following:

<code>
Collection firstObjects =  firstObjectPeer.getAll();

// .. get 1 Object from Collection (Iterator code missing, only for
understanding)
FirstObject firstObject = (FirstObject)firstObjects.next();

Iterator i = firstObject .getManySecondObjects().iterator(); //here comes
the Exception with 1.0 rc5

//do anything with every second Object
//...
</code>

If I try to get the Iterator for "ManySecondObjects"
it works well with 1.0 rc4
but with 1.0 rc5 it throws an exception (see below)
It seems to be, that the proxy dynamic loads works not in any case

but if i catch it and ask again for the Iterator
<code>
Iterator i = firstObject .getManySecondObjects().iterator();
</code>

it works
It looks like:
Trying once to load the collections throws the exception
but also sets a setting in the right way, so the second try works.

but if I load again the firstObject, it does not work,
at the first time trying to access the collection, only at the second time
(and all following tries)

Maybe I am doing sth.  wrong or
maybe someone could confirm this behaivour.

Exception with 1.0 rc5 org.apache.ojb.broker.PersistenceBrokerException
java.lang.ClassCastException
        at
org.apache.ojb.broker.core.QueryReferenceBroker$PBCollectionProxyListener.ad
dThisListenerTo(Unknown Source)
        at
org.apache.ojb.broker.core.QueryReferenceBroker$PBPrefetchingListener.prefet
ch(Unknown Source)
        at
org.apache.ojb.broker.core.QueryReferenceBroker$PBCollectionProxyListener.be
foreLoading(Unknown Source)
        at
org.apache.ojb.broker.accesslayer.CollectionProxy.beforeLoading(Unknown
Source)
        at
org.apache.ojb.broker.accesslayer.CollectionProxy.loadData(Unknown Source)
        at org.apache.ojb.broker.accesslayer.ListProxy.loadData(Unknown
Source)
        at org.apache.ojb.broker.accesslayer.CollectionProxy.getData(Unknown
Source)
        at
org.apache.ojb.broker.accesslayer.CollectionProxy.iterator(Unknown Source)


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


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

Reply via email to