DB lock method feature request #35877
-
Just as the Illuminate\Database\Connection class has a trait for managing transactions, I think it would be handy to have a trait for managing database locks. We're currently using something like (translated to Laravel DB method names as much as possible) this in our custom connection class:
An example of it being used:
It could probably be implemented better than that though, for example with separate methods for getting and releasing locks so that they could be run manually. I'm guessing the biggest argument against it would be that it wouldn't be used often enough to justify it being in the Laravel framework. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I just happened across the lock management features in the Cache library. |
Beta Was this translation helpful? Give feedback.
I just happened across the lock management features in the Cache library.
While some cases may not need to use a cache with their locks and it wasn't the most intuitive place to find locking behaviour, it does make this idea mostly redundant.
Please remove this discussion.