Skip to content

Conversation

@zackgalbreath
Copy link
Contributor

@zackgalbreath zackgalbreath commented Feb 28, 2024

updateOrCreate is apparently not atomic

laravel/framework#19372

...but upsert is???

https://stackoverflow.com/a/70978095
https://stackoverflow.com/a/70209143

@zackgalbreath zackgalbreath force-pushed the update_buildinfo_transaction branch from 9ea54ba to 0d0a33c Compare February 29, 2024 14:47
@zackgalbreath zackgalbreath force-pushed the update_buildinfo_transaction branch from 0d0a33c to 65c03ec Compare February 29, 2024 14:48
@zackgalbreath zackgalbreath changed the title Call BuildInformation::updateOrCreate inside a transaction Store BuildInformation using upsert instead of updateOrCreate Feb 29, 2024
@zackgalbreath
Copy link
Contributor Author

@williamjallen this seems to have done the trick. I haven't seen any Integrity constraint violation: 1062 Duplicate entry for key 'buildinformation.PRIMARY' since I deployed this change midday yesterday (16 hours ago or so).

Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the transaction necessary now that you're using upsert?

@williamjallen williamjallen added this pull request to the merge queue Mar 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 1, 2024
@williamjallen williamjallen added this pull request to the merge queue Mar 1, 2024
@williamjallen
Copy link
Collaborator

Delay appears to be due to a CircleCI issue

Merged via the queue into releases/3.3 with commit 8e3737a Mar 1, 2024
@williamjallen williamjallen deleted the update_buildinfo_transaction branch March 1, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants