db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Rowell <mark.row...@credittrade.com>
Subject Re: Materialising the wrong type of object when prefetching relations hips where related class is part of extent
Date Fri, 28 Jan 2005 14:30:45 GMT
Thomas Dudziak <tomdzk <at> gmail.com> writes:

> 
> Mhm, a couple of points:
> 
> * A minor thing but you should not use the id-stuff for the field
> descriptors but rather reference the foreignkey fields directly. Has
> no bearance to your problem but anyway ...
> 
> * Perhaps you should declare the ojbConcreteClass field in the whole
> hierarchy of CreditDefaultSwap, i.e. even in Instrument. Likewise, it
> might help if you duplicate Instrument's fields in the descriptor of
> InstrumentModel. Or perhaps you don't need InstrumentModel's
> descriptor ? Do you query for it (it is not used elsewhere in the
> repository file) ?
> 
> * I don't understand where in BasePrefetcher#prefetchRelationship an
> access to a field descriptor might happen. Could you set a breakpoint
> to the MetadataException and post where the exception is uttered and
> what the context is ?
> 
> Tom
> 
Tom

* I replaced field-id-ref with field-ref globally (no change)
* I put ojbConcreteClass in InstrumentModel. Will put in Instrument
  I do not use instrument model and I do not query for it...
  so can I remove it an put fields into Instrument?

So far, no change, I still get the exception

real object != null ? true
 value = Senior
 value class java.lang.String
java.lang.IllegalArgumentException
        at sun.reflect.UnsafeObjectFieldAccessorImpl.set
(UnsafeObjectFieldAccessorImpl.java:63)
        at java.lang.reflect.Field.set(Field.java:656)
        at 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew.s
etValueFor(PersistentFieldDire
ctAccessImplNew.java:216)
        at 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew.s
et(PersistentFieldDirectAccess
ImplNew.java:158)
        at 
org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.buildOrRefreshObject
(RowReaderDefaultImpl.java:121)
        at 
org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectFrom
(RowReaderDefaultImpl.java:81)
        at org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet
(RsIterator.java:443)
        at org.apache.ojb.broker.accesslayer.RsIterator.next
(RsIterator.java:265)
        at org.apache.ojb.broker.accesslayer.ChainingIterator.next
(ChainingIterator.java:322)
        at 
org.apache.ojb.broker.accesslayer.BasePrefetcher.prefetchRelationship
(BasePrefetcher.java:107)
        at 
org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks
(QueryReferenceBroker.java:329)
        at 
org.apache.ojb.broker.accesslayer.BasePrefetcher.prefetchRelationship
(BasePrefetcher.java:113)
        at 
org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks
(QueryReferenceBroker.java:329)
        at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery
(QueryReferenceBroker.java:167)
        at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery
(QueryReferenceBroker.java:233)
        at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery
(QueryReferenceBroker.java:253)
        at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery
(PersistenceBrokerImpl.java:1217)
        at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery
(DelegatingPersistenceBroker.java:
338)
        at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery
(DelegatingPersistenceBroker.java:
338)
        at 
com.credittrade.market.pc.baskets.BasketPriceLoader.fillOutReferenceLevels
(BasketPriceLoader.java:97)
        at com.credittrade.market.pc.PriceLoaderAbstractImpl.fillOutLastTraded
(PriceLoaderAbstractImpl.java:279)
        at com.credittrade.market.pc.PriceLoaderAbstractImpl.initialLoad
(PriceLoaderAbstractImpl.java:62)
        at com.credittrade.market.pc.ClientPriceLoader$InitialLoad.execute
(ClientPriceLoader.java:99)
        at com.credittrade.system.js.RPCTaskEntry.execute(RPCTaskEntry.java:63)
        at com.credittrade.system.js.TaskEntryProcessor.processEntry
(TaskEntryProcessor.java:41)
        at com.credittrade.system.js.SpaceWorker$HandOff.run
(SpaceWorker.java:230)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:675)


Sorry for the continuing hasslE..

Thanks

Mark





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


Mime
View raw message