Re: Why no 1to1 relationships?
Re: Why no 1to1 relationships?
- Subject: Re: Why no 1to1 relationships?
- From: Jeff Schmitz <email@hidden>
- Date: Tue, 1 Apr 2008 22:57:48 -0500
On Apr 1, 2008, at 10:41 PM, Andrew Lindesay wrote:
Hello Jeff;
I've decided to fully EOize my app to replace my current use of
flat files, mainly to better deal with concurrency issues. In
creating my analogous tables, I found that there's no way to
specify a "1 to 1" relationship between tables using the Entity
Modeler tool. Is there a specific reason for this? Or is it just
figured that you might as well make it one to many anyway even if
it is just one to one?
"You can't really do that" :) However if you make a 1:M
relationship you can add an accessor-method which just makes the :M
a :1 or throws a runtime exception if it find a :M with more than
one element in it. On the very rare occasions where a 1:1 has made
any sense, I have done this.
If you're wondering why I want to do this, it's to hopefully reduce
conflicts of multiple people updating the same record in a table.
Is that generally a good reason to split 1 to 1 data into two tables?
Are you looking to prevent optimistic-locking-on-write conflicts?
yes, well maybe not prevent, but reduce their likelihood.
Perhaps it would be better to implement a change-notification system
to keep the data fresh in the instances?
Ah, something else to read up on. It would be a fairly rare
occurrence, especially with split tables. And don't change
notifications still run the risk of conflicts?
cheers.
___
Andrew Lindesay
www.lindesay.co.nz
_______________________________________________
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