What do you mean when you say that you 'apply a local fix' - how is what you describe a 'fix' for anything? (You still end up with the cycles in the database, which I gather you want to do)
I mean I fix the code so it doesn't die() or loop forever anymore. A typical break is either an error about not being about the find the object linked to, or worse, an infinite loop loading the same nodes over and over.
The cycles are perfectly valid, so I'm not trying to weed them out.
Why would you be creating the id for A 'early' when you would normally generate the ids in order?
Here's the "normal" course of events in my system:
- Create an object, unsaved without an ID.
- Fill it with data. Some of the data may include the IDs of linked objects.
- Save the object, creating an ID for it.
That works great until the code finds a cycle. When I run into a cycle I fix it to:
- Create an object, unsaved without an ID.
- Fill it with data, but not the data that might cycle.
- Save the partially filled object, creating an ID for it.
- Fill in the possibly cyclic pieces.
- Save the completed object.
The problem is that doing this for each node type when I find a break is a real pain.
-sam
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.