Calling save_changes multiple times on a reference produces an error. Work around? Fix? #2816
Replies: 4 comments 3 replies
-
It's currently impossible to answer this without having more information. Please provide at least the following information:
|
Beta Was this translation helpful? Give feedback.
-
@weiznich Here is my model::Upload
Here is the schema for Upload
Compiler Here is the error message showing up on save_changes
Here is my update function test in full. I forgot to add the type annotation last time (when I call save_changes twice the compiler insists I add the type annotation on the result).
|
Beta Was this translation helpful? Give feedback.
-
My original attempt at the retrys didn't even have the type annotation but gave the same error
|
Beta Was this translation helpful? Give feedback.
-
Looks like I resolved it! Adding I found it by playing around with that simplified test I showed above. Still it's puzzling why calling it twice requires explicit type annotation but once doesn't. |
Beta Was this translation helpful? Give feedback.
-
I'm adding retrys to my update calls to retry if there is a locked database error, but I'm noticing if
save_changes
is called multiple times on the same reference I get this error. I don't fully understand what this error message is telling me.This code works in my previous code with a single save_changes
If I try the code below it yields the error I showed above. This is a simplified example calling save_changed twice.
Does anyone have insight into why this is happening and how I can make this work?
Beta Was this translation helpful? Give feedback.
All reactions