Thread:
 example on repeatable reads 
 deanhiller   08 May 2008, 03:51 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: deanhiller (08 May 2008, 03:51) Replies: 0, Views: 128
Subject: example on repeatable reads
This wiki has a great section on Why can't Hibernate just load objects
on demand? but it would be nice if someone could throw a concrete very
common example on why it is important to make sure you have repeatable
reads. 

My crappy example was you might be navigating from 2 different objects
to the same object and end up with two versions of that same object.  ie. 

child.getParent() which returns User object
shirt.getBuyers() which returns a list of User objects.

The list would have the same User object as the getParent method
returned but all of the data could have been changed.  Then you might
display that in a GUI.  Of course, the challenge back was that this
happens like .05% of the time so why complicate things by always having
to fix the LazyInitializationException...people spend more time with
that and fixing that so it is not worth it.  It seemed like a decent
argument to me.  Anyone with better examples, PLEASE post them!!!!
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]