Re: horizontal inheritance oddity
Re: horizontal inheritance oddity
- Subject: Re: horizontal inheritance oddity
- From: Mike Schrag <email@hidden>
- Date: Thu, 1 Jun 2006 10:30:09 -0400
Yeah, same guilty party, I think ... There's a chunk of code buried
down in EOF that tracks which objects should NOT have PKs generated.
There were a couple ways it could get into that code path -- one is
related to propagates PK, and the other was if the parent and child
are in two different EODatabases. When either of those cases occurs,
the object gets added to the dont-make-a-pk list, and the PK just
doesn't get put into the INSERT statement.
ms
On Jun 1, 2006, at 10:16 AM, Francis Labrie wrote:
Hi,
Mike Schrag wrote:
I probably didn't respond to this thread when I posted earlier,
but this problem ended up being inheritance-across-models-that-eof-
thinks-are-in-different-databases thing I ranted about a couple
days ago (described in http://en.wikibooks.org/wiki/
Programming:WebObjects/EOF/Using_EOF/
Common_Pitfalls_and_Troubleshooting ). I did, however, log a
radar bug for that.
Yes, I understand that. I even did reproduce it: very nasty bug...
Thanks to you for sharing this info with us.
Actually, interestingly, from tracing through finding my problem,
I believe what you're seeing is exactly the same bug in a
different form. It's the same little block of code that turns off
PK generation, just triggered from two different scenarios.
Well, when I reproduce the "propagate primary key in parent entity"
bug, there is only one database context and EOF fetch properly the
primary key for the new sub-entity. So in this case, the stack have
the right primary key. But unfortunately, the "INSERT" clause loose
it when generated...
Francis Labrie wrote:
Chuck Hill wrote:
Mike Schrag wrote:
[...]
abstract (though the same problem occurs either way). When I
run my app, and create new Entity B's, the insert statements
don't include the primary key (resulting in an integrity
constraint violation). If i edit the model and simply remove
the parent entity reference from Entity B, and restart,
everything works perfectly. That fix is ACTUALLY is not that
big of a deal from a runtime perspective, except that I need
the parent reference for EOGenerator to work properly
(basically I care more about the inherited methods than I
particularly care about it actually having a relationship in
the model). Anyone seen this one before? It's been driving me
crazy today -- I have to believe I'm just overlooking something
silly.
Are there any entities with a relationship to the parent that
have the relationship marked as Propogate Primary Key? If have
seen this cause the primary key to not get generated even the
objects in question were created but not related. I have been
bitten by that recently, and it was very hard to track down.
I can confirm that problem: I've got exactly the same bug having
primary key propagation set in parent entity relationship. This
bug is very hard to track indeed: did you already report it to
radar? If not, I can fill a report.
--
Francis Labrie
Saint-Bruno-de-Montarville, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mdimension.com
This email sent to email@hidden
_______________________________________________
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