> well in general it works... there were some calculations before using the
parent instance, 
> but somewhen it stops because of a NullPointerException.
> it looks like a data container ran into an overflow, threw away some
> database objects and didn't reload 
> them as they were accessed. as i wrote before: when i load them,
> everything is well referenced.

It is difficult for me to comment without understanding the problem further. 

> if you think, using <inheritance> and <discriminator...> could help in
> that way,

JPA will call your intent of storing each derived type from a common base
type to separate tables as TABLE_PER_CLASS strategy. As that is not the
default strategy for inheritance mapping, there should be a <inheritance>
specification within the <entity>. <discriminator> is not relevant because
you are not using SINGLE_TABLE strategy where each record type must be
discriminated from other type stored in the same table.

> can you give an example, where i need to put this <inheritance> and
> <discriminator...> stuff? 
> can you please make an example for the superclass and one derived class?

I can, but it will take a while as I am in the middle of something else.
Please browse OpenJPA test source codes -- it has examples of such
inheritance mapping with @MappedSuperclass.

> its openJPA 1.2.2 by the way... 
That can be a reason -- remember fixing a significant error in
MappedSuperclass post 1.2.2 -- if possible try to switch to a 2.0 version to
check if things improve.


-----
Pinaki 
-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/Parent-reference-is-loaded-but-disappears-while-working-with-the-object-tp5728025p5744493.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to