CodeIgniter Forums
CI4 Database Pessimistic Locking Row - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forum-29.html)
+--- Thread: CI4 Database Pessimistic Locking Row (/thread-67672.html)



CI4 Database Pessimistic Locking Row - arma7x - 03-23-2017

Does codeigniter 4 database library will have pessimistic locking feature like laravel eloquent does, https://laravel.com/docs/5.4/queries#pessimistic-locking


RE: CI4 Database Pessimistic Locking Row - Narf - 03-23-2017

Do you know what a pessimistic lock is in the first place, or are you just asking just because Laravel?


RE: CI4 Database Pessimistic Locking Row - arma7x - 03-23-2017

(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.


RE: CI4 Database Pessimistic Locking Row - Narf - 03-23-2017

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.


RE: CI4 Database Pessimistic Locking Row - arma7x - 03-23-2017

(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".