Welcome Guest, Not a member yet? Register   Sign In
CI and Row Locking
#1

[eluser]njkt[/eluser]
Hello,
My question is in regards to database row locking. How is this accomplished with codeigniter?

My database is MySQL/InnoDB.

The basic problem is that when I remove/update based on an ID it needs to lock that row and the associated rows from the other tables so other users cannot modify it while this action is in progress.

I appreciate any assistance.
#2

[eluser]Phil Sturgeon[/eluser]
Locking a row while an admin user updates a form is not a DB feature, but is part of the application. You need to put in a flag or a row in another field, which is entered when a user clicks edit. Then it either expires after a set amount of time or has to be unlocked before somebody else can do it.
#3

[eluser]PhilTem[/eluser]
Have a look at Joomla or DokuWiki, both have this kind of feature.

Basically you will need another table that stores which item is locked by whom and either allows access or denies depending on the locked state.
Sounds pretty simple though Wink
#4

[eluser]njkt[/eluser]
Thanks for the idea, I chose the option of having a separate table for the locked row id's that way I can just add functionality to the model instead of touching the majority of the database.




Theme © iAndrew 2016 - Forum software by © MyBB