Re: Cycles found on save in 4.2.1

2024-08-20 Thread Hugi Thordarson
Judging from some very, very basic experimentation, Cayenne seems to do fine with UUID PKs. Db generated UUIDs really just work like serial integers with a different generated value type: https://github.com/hugithordarson/xx-c42/blob/main/src/main/java/family/MainUUIDDbGenerated.java …and the

Re: Cycles found on save in 4.2.1

2024-08-16 Thread Michael Gentry
If UUID PKs are really going to be a thing, we should probably add them to Cayenne... On Fri, Aug 16, 2024 at 9:44 AM Hugi Thordarson wrote: > Hi Michael! > > Sure, the UUID comment was meant as a bad joke, my world is all DB > generated integer keys. > > That being said, I've wanted to try out

Re: Cycles found on save in 4.2.1

2024-08-16 Thread Hugi Thordarson
Hi Michael! Sure, the UUID comment was meant as a bad joke, my world is all DB generated integer keys. That being said, I've wanted to try out UUID keys for a while. Sure, they're ugly as all h*** and performance would suffer (although for the size of DBs I usually deal with I don't think it w

Re: Cycles found on save in 4.2.1

2024-08-16 Thread Hugi Thordarson
Just ran our tests with your updates and everything works like charm. Thanks Nikita! I owe you quite a few [beverage of choice]. Cheers, - hugi > On 16 Aug 2024, at 13:45, Nikita Timofeev wrote: > > Finally understood what's going on. It was a regression in the new > FlushAction [1]. Old one

Re: Cycles found on save in 4.2.1

2024-08-16 Thread Michael Gentry
Hi Hugi, >From what I've read, UUID PKs have poor index performance and take up more storage. Wouldn't it be better to use an integer sequence like PostgreSQL and Oracle support? You can generate your PKs up front and Cayenne already knows how to deal with them. Thanks, mrg On Thu, Aug 15, 202

Re: Cycles found on save in 4.2.1

2024-08-16 Thread Nikita Timofeev
Finally understood what's going on. It was a regression in the new FlushAction [1]. Old one didn't sort updates in any way. So two issues later (and one optimization), it should be better now. [1] https://issues.apache.org/jira/browse/CAY-2868 On Thu, Aug 15, 2024 at 3:49 PM Hugi Thordarson wrot

Re: Cycles found on save in 4.2.1

2024-08-15 Thread Hugi Thordarson
Hi Nikita, again, thanks for looking into this! And yeah, totally understand how we're not about to insert everything in one commit. Well, at least until the universe decides it's time everyone move to app generated UUID PKs and deferred constraint checks :). Cheers, - hugi > On 14 Aug 2024

Re: Cycles found on save in 4.2.1

2024-08-14 Thread Nikita Timofeev
In this case it seems like a true cycle, the Person entity has two relationships to self. And that particular case Cayenne didn't handle well historically. But looking at it, I want to try and tweak the new Graph-based sorter, because two updates generated shouldn't depend on each other. So maybe i

Re: Cycles found on save in 4.2.1

2024-08-14 Thread Hugi Thordarson
Hi again Nikita! saw the fix you made yesterday and it works great for the test I created, so thanks for that! However, turns out that for the more complex case in our actual project, the operation still fails. I've added a new example to the test project that models that case a little more cl

Re: Cycles found on save in 4.2.1

2024-08-13 Thread Hugi Thordarson
Hi Nikita, glad to hear this and that the example helped out, thanks for the quick reply and for being awesome :). Cheers, - hugi > On 12 Aug 2024, at 13:52, Nikita Timofeev wrote: > > Hi Hugi, > > Thanks for the perfect example, that's always my main problem. > I've found the issue with the

Re: Cycles found on save in 4.2.1

2024-08-12 Thread Nikita Timofeev
Hi Hugi, Thanks for the perfect example, that's always my main problem. I've found the issue with the new flush logic [1]. The last operation creates two logical changes (DbRowOps), and one of them is later discarded as there's nothing to flush to the DB. However it's discarded only after the sort

Re: Cycles found on save in 4.2.1

2024-08-09 Thread Hugi Thordarson
Hi Andrus, I've been taking a look at this with Maik, here's a runnable example project containing a commit that works on v4.1 but fails in v4.2: https://github.com/hugithordarson/xx-c42/ Quick link to the code actually demonstrating the failure: https://github.com/hugithordarson/xx-c42/blob/mai

Re: Cycles found on save in 4.2.1

2024-08-08 Thread Andrus Adamchik
Hi Maik, Could you provide an example of a failing graph? Thanks, Andrus > On Aug 7, 2024, at 7:31 AM, Maik Musall wrote: > > Hi everyone, > > we upgraded an application from Cayenne 4.1.1 to 4.2.1, and now we’re getting > more cyclic graph errors from AshwoodEntitySorter. Years back we alre

Cycles found on save in 4.2.1

2024-08-07 Thread Maik Musall
Hi everyone, we upgraded an application from Cayenne 4.1.1 to 4.2.1, and now we’re getting more cyclic graph errors from AshwoodEntitySorter. Years back we already had a similar problem, but @SortWeight didn’t help and GraphBasedDbRowOpSorter wasn’t ready. The latter is now in 4.2 stable but fa