On 1/07/2016 11:01am, Andrus Adamchik wrote:
> So there are tradeoffs and challenges and this won't be an easy task. But if 
> anyone feels like applying their graph theory knowledge to a non-trivial 
> problem, please speak up :)

Although I don't have a solution, I have three observations/questions:

1. The Cayenne model will need to have additional metadata about database 
indexes and constraints. I've always liked that idea anyway but lacked the time 
to work on it personally. It could open up interesting interactions with 
projects like liquibase [1]

2. Has Hibernate or any other ORM solved this problem in an interesting way? 
[2] Hibernate appears to split "collection deletes/inserts" which I presume 
means "to-many" joined records.

3. Keeping the order that changes are added to the context is another simple 
approach that leaves it up to the developer to get it right in code. It doesn't 
quite tell us what to do with two updates to the same object that are collapsed 
into one, but otherwise it seems sensible as an option.


[1] https://github.com/liquibase/liquibase-hibernate for a simplistic approach, 
but we could go much further.

[2] 
http://stackoverflow.com/questions/12616336/how-is-hibernate-deciding-order-of-update-insert-delete

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Reply via email to