Thank you for your response. Unfortunately, last_insert_rowid is not thread safe and should be used
Thank you for your response.
Unfortunately, last_insert_rowid is not thread safe and should be used only in the same transaction. (Its local to the connection actually, but if the connection drops, you're left with tangling rows).
Having a temporary table is equivalent to having the same table with a flag (is_orphan) I think.
As for the guid, you're in the mercy of collisions, maybe equivalent to having a monotonically incremented separate table (sequence).
Unfortunately, it is indeed a 2-phase-commit problem, no solution feels right. Which is why posted the question on how people are handling it.
It is very unfortunate that D1 forces these problems on the consumer and that there is no clear guidance. Is it that much of a corner case wanting to insert an "order" with "order-lines" in a transactional manner?
Unfortunately, last_insert_rowid is not thread safe and should be used only in the same transaction. (Its local to the connection actually, but if the connection drops, you're left with tangling rows).
Having a temporary table is equivalent to having the same table with a flag (is_orphan) I think.
As for the guid, you're in the mercy of collisions, maybe equivalent to having a monotonically incremented separate table (sequence).
Unfortunately, it is indeed a 2-phase-commit problem, no solution feels right. Which is why posted the question on how people are handling it.
It is very unfortunate that D1 forces these problems on the consumer and that there is no clear guidance. Is it that much of a corner case wanting to insert an "order" with "order-lines" in a transactional manner?





