CodeIgniter Forums

Full Version: CI4 Database Pessimistic Locking Row
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does codeigniter 4 database library will have pessimistic locking feature like laravel eloquent does, https://laravel.com/docs/5.4/queries#pes...ic-locking
Do you know what a pessimistic lock is in the first place, or are you just asking just because Laravel?
(03-23-2017, 05:00 AM)Narf Wrote: [ -> ]Do you know what a pessimistic lock is in the first place, or are you just asking just because Laravel?

Yes, i know it. Just like how CI lock session row in database until finish updating it. And I want to lock the row until finished with it.
Well, if you know what you want to do with it - fair enough.

Though, I asked more about the "pessimistic" part, as a) pretty much nobody uses that term in PHPland; and b) it is wrongly described in the Laravel manual you linked to - a shared lock is not pessimistic.
(03-23-2017, 11:43 AM)Narf Wrote: [ -> ]Well, if you know what you want to do with it - fair enough.

Though, I asked more about the "pessimistic" part, as a) pretty much nobody uses that term in PHPland; and b) it is wrongly described in the Laravel manual you linked to - a shared lock is not pessimistic.

Not sharedlock() but lockforupdate() as mention in laravel eloquent, "Prevent the rows from being modified or from being selected with another shared lock".