db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kalén <martin.ka...@curalia.se>
Subject List proxies with prefetchingAll=false broken in CVS HEAD?
Date Fri, 12 Dec 2003 17:00:50 GMT
Greetings OJB-developers,
  a Friday night quiz for everyone involved in collection proxies, 
prefetching and QueryReferenceBroker! ;-)

On a serious note - when upgrading from OJB1.0RC4 to CVS HEAD (as of 12 
Dec 2003) runtime instantiation of some collection-refereces broke in 
our application. I got a ClassCastException in some of our testcases, 
but most of them were still fine.

I tracked the problem down to a collection-descriptor with proxy="true" 
and a local field of type List. When debugging into OJB-code I could see 
that this happens in the QueryReferenceBroker#prefetch(Object)-method. 
And only when owners.size() <= _limit is not true (131<=51=false in this 

On line 852:
852: addThisListenerTo(owners.get(0))
will try to call PBCollectionProxyListener#addThisListenerTo(Object)
and since owner is a list of concrete owner objects and not the proxy 
itself, line 867:
867: _listenedCollection = (CollectionProxy) listenedObject;
generates a ClassCastException.

If I change line 852 to pass the CollectionProxy-object 
("listenedObject") to addThisListenerTo, like:
852: addThisListenerTo(listenedObject);
everything seems to work fine.

Any comments?

Have a nice weekend,

Martin Kalén
Curalia AB              Web:  http://www.curalia.se
Orrspelsvägen 2B        Mail: info@curalia.se
SE-182 79  Stocksund    Tel:  +46-8-410 064 40

To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

View raw message