Replies: 6 comments 6 replies
-
The |
Beta Was this translation helpful? Give feedback.
-
Well doing it in another connection may or may not be what you want. But yes, streaming puts the connection in a special state where you can't execute queries. Also, since the stream lives "inside" a transaction, you can't end that transaction before completing the stream. The only part that's wrong about this is that the error message shouldn't say "while 'check_if_data_exists is still active" — it should refer to the stream as still active instead. |
Beta Was this translation helpful? Give feedback.
-
I just opened #880 to fix the error message. |
Beta Was this translation helpful? Give feedback.
-
Your checks are trying to do in |
Beta Was this translation helpful? Give feedback.
-
Yeah but I don't really want to do any action upon conflict. I want to know beforehand if the conflict exists and WHICH field is conflicting, to be able to extract relevant information to present in the diagnostic. And if not beforehand, then simply afterwards, but in a sane way that doesnt introduce partial results on the database and doesnt impose catching and parsing exceptions. I just now tried to do the same thing with plain exec prepared and Im getting the "started another transaction blah blah" error, which is, well, expected, but Im kinda frustrated that there doesnt seem to be a nice and easy way to do that. |
Beta Was this translation helpful? Give feedback.
-
By the way @Dich0tomy — more or less the same question also came up in #881. |
Beta Was this translation helpful? Give feedback.
-
Hello, I have a code that looks something like this:
data_already_in_database
is defined +- like this:Now, this doesn't work - I get an exception -
Started new command 'check_if_data_exists' while command 'check_if_data_exists' was still active
, which is kinda disappointing to me, as Im commiting the transaction so it should be ready to start another one right away, but alright.The question is then, how can I do this to work at all? I'd be glad if
stream.complete()
itself could return some nicestd::expected
or something, but sadly the entire API is exception based, Im not sure what to expect.Beta Was this translation helpful? Give feedback.
All reactions