Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

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

What would be the workaround for the same error if we are using Redis as a cache, PostgreSQL in cluster mode, and a connection pool? #55212

Closed
mtt786 opened this issue Mar 30, 2025 · 0 comments

Comments

@mtt786
Copy link

mtt786 commented Mar 30, 2025

I'm not sure there is a way around this on our end. This how Postgres works if a query error is encountered within a transaction, and the database cache works atomically by attempting to insert the record and if it gets an exception it will update the record instead. This is similar to the approach Symfony takes.

So, my work around suggestion is to define a separate connection in your Laravel configuration for the cache.

image

Then, set your lock_connection in your cache configuration file:

image

Originally posted by @taylorotwell in #36280

@laravel laravel locked and limited conversation to collaborators Apr 2, 2025
@crynobone crynobone converted this issue into discussion #55248 Apr 2, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant