Hi,
I am writing an object that deals with creating a new account, and it has various functions that lock and unlock database tables while they are going about their work.
I have read that once the script has finished, all table's are automatically unlocked, which is fine. But I need to define exactly what a 'finished script' is.
It’s pretty obvious when you are dealing with a fully self contained script, but I am a little unsure when using objects and functions from included files.
I do not want the tables to get unlocked until I specifically ask them to be. But I also don’t want to use a persistent connection incase the tables don’t get unlocked for some reason.
Once I have locked a table, I will unlock it later, but from within another function.
Here is an example:
Main.php
Class.php
Main.php creates an object from Class.php. Main then runs a function within the new class that locks a table.
Does the table get unlocked when the function within the class is finished? Or must Main.php finish for the table to get unlocked?
I hope I have explained myself clearly enough.
Thanks in advance.