What are the risks of storing a hibernate managed object in cache and how to resolve this problem?

With an answer of something along the lines of the following; The primary problem here is the object will outlive the session it came from. Lazily loaded properties won’t get loaded if needed later. To overcome the problem, cache just the object’s id and class, then have retrieve the object in the current session context.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: