We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi guys,
You have some critical issues in fhirbase_create and fhirbase_update functions.
_sql := format($SQL$ WITH archived AS ( INSERT INTO %s (id, txid, ts, status, resource) SELECT id, txid, ts, status, resource FROM %s WHERE id = $2 RETURNING * ), inserted AS ( INSERT INTO %s (id, ts, txid, status, resource) VALUES ($2, current_timestamp, $1, 'created', $3) ON CONFLICT (id) DO UPDATE SET txid = $1, ts = current_timestamp, status = 'updated', resource = $3 RETURNING * )
Under heavy load functions sometimes fail with error like: duplicate key value violates unique constraint "<resource_name>_history_pkey"
duplicate key value violates unique constraint "<resource_name>_history_pkey"
Just imagine two parallel transactions, whey trying to change the same resource...
First transaction win)
It's not about transaction isolation. This is a logical issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi guys,
You have some critical issues in fhirbase_create and fhirbase_update functions.
Under heavy load functions sometimes fail with error like:
duplicate key value violates unique constraint "<resource_name>_history_pkey"
Just imagine two parallel transactions, whey trying to change the same resource...
SELECT id, txid, ts, status, resource
FROM %s
WHERE id = $2
RETURNING
INSERT INTO %s (id, txid, ts, status, resource)
First transaction win)
It's not about transaction isolation. This is a logical issue.
The text was updated successfully, but these errors were encountered: