Re: Cannot obtain globalId for an object which...

2016-09-20 Thread Ricardo Parada
Hi Chuck, I followed the steps of the code and I noticed that the object containing the to-many relationship in question is being local instanced in a peer editing context. The to-many is still an array fault which has not been triggered. Then when the object in the original context has its

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread Chuck Hill
This is why they are getting inserted again: Well, logging out "currentUser.editingContext().committedSnapshotForObject(currentUser)['userDataBlock']" before saveChanges, I get an empty array. I must admit I don't know whether there should be the relationship objects in this snapshot, but

Cannot obtain globalId for an object which...

2016-09-20 Thread Ricardo Parada
Hi all, All of a sudden one of our apps started getting this. Does anybody know why this would happen? It did not seem to have a problem before until now. Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext, object: ,

Changes

2016-09-20 Thread Mark Wardle
I enclose some simple diffs for wonder 7 - snapshot. The first is a simple typo but its presence is irritating my sensibilities in my log files. diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/navigation/ERXNavigationItem.java

Re: Cannot obtain globalId for an object which...

2016-09-20 Thread Chuck Hill
A full stack track would help. It sounds like your code is making a relationship between objects in different editing contexts. Did someone forget to add a “localInstance”? From: on behalf of Ricardo Parada

EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread o...@ocs.cz
Hello there, I have a pretty common setup: entities User and DataBlock, an M:N relationship represented by an intermediate entity containing just the two keys, flattened on both sides. At both sides the relationships are appropriately flattened. Set to own destination+delete rule cascade. The

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread Samuel Pelletier
OC, Did you created the M:N relationship using the modeler or you created it manually ? These are tricky to correctly configure. Your situation may be caused by an improper flattened relationship settings. The flattened relationships should have nothing checked in the Advanced pane of the

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread o...@ocs.cz
Chuck, > On 20. 9. 2016, at 10:48 PM, Chuck Hill wrote: > > This is why they are getting inserted again: > Well, logging out > "currentUser.editingContext().committedSnapshotForObject(currentUser)['userDataBlock']" > before saveChanges, I get an empty array. I must admit

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread OC
Chuck, On 21. 9. 2016, at 2:40, o...@ocs.cz wrote: > Aside of that, I have added a log into the > DatabaseContextDelegate.databaseContextShouldUpdateCurrentSnapshot method, > and here I *never* get *anything* for the relationships: neither the old > (which is presumable) *nor the new*

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread Chuck Hill
Off the top of my head, check they types of the keys to, as defined in the EOModel, to the M:N table and in the M:N table. Are all consistently Integer or Long in Java? Chuck From: OC Date: Tuesday, September 20, 2016 at 6:33 PM To: Chuck Hill Cc:

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread Chuck Hill
But when is it not set? After fetching into the EC? After faulting it in? Is there there at first and then goes away? There is a method in Wonder that can clear a to-many relationship, but that should make it a fault not an empty array. You really DO find all of the best bugs! :-) Chuck

Re: Cannot obtain globalId for an object which...

2016-09-20 Thread Chuck Hill
Does this only happen sometimes? “the databaseContext's active editingContext” is referring to the active EC, which is transactional (e.g. set at the start of an EOF operation and cleared at the end). If the code is calling into EOF without locking, it might result in this. From: Ricardo

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread o...@ocs.cz
Just a quick followup -- sorry, forgot to copy/paste the 2nd part of the log, though I fear it would not help much — it just confirms the user's snapshot does not get changed either: > On 21. 9. 2016, at 2:40 AM, o...@ocs.cz wrote: > > Chuck, > >> On 20. 9. 2016, at 10:48 PM, Chuck Hill

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread OC
Samuel, On 21. 9. 2016, at 1:24, Samuel Pelletier wrote: > Did you created the M:N relationship using the modeler or you created it > manually ? Manually (well through my own modeller, which boils down to precisely the same result). Nevertheless, I have done this umpteen

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread OC
Chuck, all my PKs/FKs are the same: - "INTEGER" for SQL type - "NSNumber" for class name - "i" for value type Thanks a big lot! OC On 21. 9. 2016, at 3:40, Chuck Hill wrote: > Off the top of my head, check they types of the keys to, as defined in the > EOModel, to the

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread Chuck Hill
I bet Alice was a developer too. Have you overridden any of the EOF methods, or the generated methods in User or DataBlock and changed the normal behavior? Or forgotten to call super? From: OC Date: Tuesday, September 20, 2016 at 6:33 PM To: Chuck Hill Cc: