Consistent reads
Consistent reads
- Subject: Consistent reads
- From: Miguel Arroz <email@hidden>
- Date: Wed, 6 Dec 2006 22:13:03 +0000
Hi!
I was having a small discussion about ORB mapping frameworks, and
I found out something that I could not solve with WO, at least with
the knowledge I have.
My question is, how can I make sure that, when I'm reading several
objects from the DB, they are consistent with each other?
Imagine I have:
EOEditingContext context = new EOEditingContext();
SomeEOObject object1 = readObject1(context);
// comment
SomeEOObject object2 = readObject2(context);
NSLog.out.appendln(object1.someProperty());
NSLog.out.appendln(object2.someProperty());
context.dispose();
So, it's a read-only operation that displays values from data
stored. My question is, how can I make sure that object1 and object2
are consistent between each other? There could be some other
instance of the application modifying objects 1 and 2 right on my
"comment" line. So, I'm reading object1 BEFORE that operation, and
object2 AFTER that operation. Their values would not be consistent
between each other.
As I never commit (because there's no changes) I cannot use
optimistic locking to detect this inconsistence.
How do you solve this kind of problem? Locking the rows would not
work, because I may have a more complex example where I can know what
object2 is only after getting object1, so I would only lock object2
after fetching object1, and the problem would be the same.
Yours
Miguel Arroz
"The world lies in the hands of evil
And we pray it would last" -- Apocalyptica, Life Burns!
Miguel Arroz
http://www.ipragma.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden