Certainly would be nice to fix CAY-1898. Can't say when we get to it, but it is certainly in the queue. And patches/pull requests are welcome ;)
Andrus > On May 18, 2016, at 9:38 AM, Andrea Biasillo <a...@dataloy.com> wrote: > > Hi! > > First sorry for my late reply, but here in Norway there have been some bank > holiday that gave us almost a free week, not BAD! > > Second thank you very much for your response, it was very useful. Actually we > had already implemented your solution, but for a bug to our exceptions > framework the RunTime exception was not thrown to our application server so > the transaction was not rolled back. This missed leading us let thinking that > the Cayenne commitChanges() some how forced the database commit. But after > reading your reply we discovered the problem and now everything works fine. > Of course would be be better to have just one commitChanges and let Cayenne > to care about the order of CREATE, UPDATE and DELETE, do you have any plans > for this? > > Many regards > > On Thu, May 12, 2016 at 4:12 PM, Andrus Adamchik <and...@objectstyle.org> > wrote: > Re-reading CAY-1898, it is about unique constraints, not FK constraints. So > this is not about cycles, and my explanation does not apply :) The first > workaround applies though (which is the same as what Ari had suggested in the > original reply: https://lists.apache.org/thread.html/Z8c9iuyg8obghec ) > > Andrus > > > > On May 12, 2016, at 7:08 AM, Andrus Adamchik <and...@objectstyle.org> wrote: > > > > Hi Andrea, > > > > We saw your message to dev@ already, and there was a reply: > > > > https://lists.apache.org/thread.html/Z8c9iuyg8obghec > > > > I guess you haven't seen it as the reply was sent to the list, not to you > > directly. So now I am including your address in cc:. > > > > Now back to your question. Cayenne does operation ordering to satisfy the > > constraints. But the graph sort algorithm has a few known limitations. > > Namely it doesn't know how to order dependency cycles (e.g. Employee -> > > Department -> Manager, who is also an employee). Those have to be resoled > > manually. There are two solutions: > > > > * Manual two-step commits - helps to resolve real cycles, when there's no > > valid ordering satisfying the constraints at all. > > * @SortWeight annotation, which forces a certain predefined commit order > > between two or more entities. It helps to resolve cases with "virtual" > > cycles (where Cayenne thinks there's a cycle, but the actual commit still > > has a valid operation ordering that satisfies constraints). > > > > Andrus > > > >> On May 12, 2016, at 1:15 AM, Andrea Biasillo <a...@dataloy.com> wrote: > >> > >> Hi! > >> > >> My name is Andrea Biasillo, I am software architect in Dataloy AS, Bergen > >> Norway. In one of our project we use Cayenne as ORM. Unfortunately we are > >> facing the same problem reported by this case: > >> > >> https://issues.apache.org/jira/browse/CAY-1898 > >> > >> Is this case never been taken in consideration? Is there a solution or at > >> least a work-wround? > >> > >> Many regards > >> > >> -- > >> > >> Andrea Biasillo - Dataloy Systems > >> > >> P: +47 55 36 03 00 > >> > >> M: +4746542580 <%2B47%2055%2036%2003%2000> > >> > >> Dataloy Service Desk <http://support.dataloy.com/> > >> > >> Dataloy Knowledge Base <http://kb.dataloy.com/> > >> > >> Subscribe to the Dataloy Newsletter > >> <http://dataloy-systems.com/?page_id=591> > >> > >> twitter.com/dataloy > >> > >> www.dataloy-systems.com > > > > > > > -- > Andrea Biasillo - Dataloy Systems > P: +47 55 36 03 00 > M: +4746542580 > Dataloy Service Desk > Dataloy Knowledge Base > Subscribe to the Dataloy Newsletter > twitter.com/dataloy > www.dataloy-systems.com >