I have 2 persistent entities A and B that are mapped on the same
table.
I don't use inheritance, the 2 objects have to be mapped separately
(this is a design choice in this case) and they overlap in some
properties.
Given this scenario, I have a doubt: can I use second level cache
without problems?
I.e.: if I update entity A (so the entity is updated in the cache and
in the db), what happens if I then read entity B (with the same
identifier)?
Let's suppose that B was in the cache: do I obtain outdated data? If
so, what can I do to avoid such an unpleasant  situation? Do I have to
NOT CACHE entity B?

I append this informations:

1. I don't use NH directly, but through another framework (Spring.Data
in particular), so I generally don't handle direcly NH objects: this
means that generally I am in 2 distinct sessions when I handle A and
B.

2. Entity B can be readonly

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to