• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI and Row Locking

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.

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

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

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.