-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded Update Error #141
Comments
Hmm that seems strange. We have several models that use lots of embedded documents. Do you have more of the stack trace handy? |
That's all the reason(?) code said from the Right now, I'm just doing the ids for the parent documents. Also, do your models with lots of embedded documents have more that one type of embedded document? I noticed that I'm getting this the most with my "Edge" documents. They have lists of "EdgeRequirements" and "EdgeEffects". |
Yes they have lots of nested embedded relationships. There are also some On Sat, Jul 12, 2014 at 2:46 PM, David Patrick [email protected]
Gordon L. Hempton |
Alright; I setup my server to "pass-through" all of the client ids, revs, etc.... But I still occasionally get that error. Just now, I actually got it while removing a lot of documents. I'm going to see if I can get a stack trace on it. Until then, I'll post my latest request/response/hash. PUT /api/v1/edges/53c1d7bf97000054aa57aa41:
Response 200:
Hash after
|
I removed my error handler from the
Any ideas? |
Found the source and line number for you, in case that helps:
|
So.... I'm just about done converting my app over to EPF; but this remains a blocking issue. Please let me know if there's anything I can provide that would help us to find a fix/workaround. Thanks. |
Hmm I would like to get to the bottom of this. You said that this happens On Wed, Jul 16, 2014 at 12:15 PM, David Patrick [email protected]
Gordon L. Hempton |
In the original ticket, I thought that this only happened after adding many documents. Lately, I've just been getting this any time there's a change to a list. My long comment from four days ago shows the request/response/afterDeserialization. |
What do you mean a change to a list? |
I think that the following code examples should illustrate what I mean. In the controller, I sometimes create the embedded models right there and add them. For cases where items are being removed from a list, I'll use Models:
Controller:
Route:
|
Can you try:
I'm thinking there might be an issue updating the inverse for some reason. |
Doesn't seem to help. So, in another place in my app I'm able to replicate this error much more easily. Note that I only ever edit documents within a child session.
My current theory about this, is that the parent session is being told:
I also think that I may be getting this error more deterministically from this section in my app, because the embedded child has a relational |
Ah so you are re-adding a child with the same id? I think semantically On Wed, Jul 16, 2014 at 3:44 PM, David Patrick [email protected]
Gordon L. Hempton |
Yes. Removing a Child should delete it. But I've been generating IDs for my embedded objects. These generated id's all follow a similar pattern. Removing an embedded document, then adding a new embedded document caused the new document to have the same ID as the old one. I'm working on changing that now to see if that resolves things. |
That makes sense. I hope this resolves it as well. On Wed, Jul 16, 2014 at 3:59 PM, David Patrick [email protected]
Gordon L. Hempton |
Hmm..... At this point, I'm not seeing any way around having to update every single sub-document in my database to have it's own id. I was really hoping to avoid needing to do that. |
Yeah unfortunately I think that is going to be required for the short term. This could be avoided in the future with additional logic on EPF's end. In our app we have unique id's on our embedded sub-documents. |
Well... I'm storing the embedded document ids for one of my Models now. But I'm still getting random errors:
Not sure what to do now.... |
Sorry you are having issues. We use embedded records quite extensively, but the embeddedness stops at the rest level (as our backend is relational). I'd be happy to skype/pair etc. with you to get this to work. You are pioneering using a document store with epf. |
After echoing back the "client_id" that was provided by EPF for the parent document, I discovered a non-deterministic error that occurs on updates. (Haven't been able to replicate it for create yet, but that doesn't mean it can't happen...)
I'm assuming that the problem would resolve itself if I included the client_id for every embedded document as well... I'm just reporting this here in hopes that we can work toward a version where client_id isn't required from the server.
Here's the error:
Adding several sub-documents to the parent document seems to increase how often this occurs. So far, I haven't been able to duplicate this when removing many sub-documents.
The text was updated successfully, but these errors were encountered: