Sorry -- should have gone to ojb-user!

BTW -- the class that OJB thinks it should get the class descriptor for is
the "first" (look in ChainingIterator for what this means)
concrete sub-class in the extent.

Many thanks

Mark
-----Original Message-----
From: Mark Rowell 
Sent: 25 January 2005 12:25
To: '[email protected]'
Subject: Materialising the wrong type of object when prefetching
relationships where related class is part of extent


Hi

I have loked on the ail list and found something similar to this. Certain
times when I query a particular class That is not part of an extent but has
(indirect) references to other objects that are part of an extent I get
materialisation errors:

org.apache.ojb.broker.metadata.MetadataException: IllegalAccess error
setting field:rank in
object:com.credittrade.instruments.derivatives.CreditDefaultSwap
        at
org.apache.ojb.broker.accesslayer.BasePrefetcher.prefetchRelationship(BasePr
efetcher.java:137)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(QueryR
eferenceBroker.java:329)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryRe
ferenceBroker.java:167)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryRe
ferenceBroker.java:233)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryRe
ferenceBroker.java:253)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Persis
tenceBrokerImpl.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.options.OptionPriceLoader.fillOutReferenceLevels(O
ptionPriceLoader.java:83)
        at
com.credittrade.market.pc.PriceLoaderAbstractImpl.fillOutLastTraded(PriceLoa
derAbstractImpl.java:313)
        at
com.credittrade.market.pc.PriceLoaderAbstractImpl.initialLoad(PriceLoaderAbs
tractImpl.java:57)
        at
com.credittrade.market.pc.ClientPriceLoader$InitialLoad.execute(ClientPriceL
oader.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.ja
va:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
75)
        at java.lang.Thread.run(Thread.java:595)

After delving through the code even though OJB "knows" that I am trying to
materialize an instance of a CreditDefaultSwap It is using the class/field
descriptors for another type in the extent. The class I want
(CreditDefaultSwap) Has a field converter for the field/column causing the
problem but the other class does not & hence when OJB attempts to set The
field into the object we get an IllegalAccessException as it is triyng to
place an unconverted value into the field.

All classes in the extent causing the problem are mapped onto a single
table. The primary key is an INTEGER and is guarantted to be Unique (I have
a UNIQUE PK constraint on the column) and I have queried the table for the
relevant ID (for the problem object The primary key has the right
ojbConcreteClass value in the table (CreditDefaultSwap).

Has anyone come up against this before.

I am using v1.0.1 & Java 5. The line numbers may not quite be correct as I
have some print statement in place for debugging...

Thanks

Mark Rowell

-------------------------------------------
Mark Rowell
Structured Credit Europe
CreditTrade Limited
No. 1 London Bridge, 6th Floor
London SE1 9QL

Tel +44 (0)20 7098 1653

http://www.credittrade.com

 

CreditTrade Limited is regulated by the FSA. (c) CreditTrade 2005. All rights 
reserved. The information and data contained in this email is provided for the 
information purposes of the addressee only and should not be reproduced and/or 
distributed to any other person. It is provided without any warranty whatsoever 
and unless stated otherwise consists purely of indicative market prices and 
other information.

Any opinion or comments expressed or assumption made in association with the 
data or information provided in this email is a reflection of CreditTrades 
judgement at the time of compiling the data and is subject to change. 
CreditTrade hereby makes no representation and accepts no responsibility or 
liability as to the completeness or accuracy of this email.

The content of this email is not intended as an offer or solicitation for, or 
recommendation of, the purchase or sale of any financial instrument, or as an 
official confirmation of any transaction, and should not be construed as 
investment advice.

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

Reply via email to