CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 MySQL/PHP Record Locking

Print topic Send  topic

Author Message
michaelwpayton

Posts: 18
Posted: 03/08/2007, 3:24 PM

Can anyone direct me to a writing/documentation that outlines CCS support for record locking in the apps it generates? Or, if there is no such documentation, anything you know about the subject would be appreciated.

Thanks,

Mike
View profile  Send private message
gbolz

Posts: 13
Posted: 03/17/2007, 4:01 AM

Mike,
I solved the record locking problem for my intranet application in this way:
1. For processes which grant numbers, f.e. invoice id, I write the user id as lock id in the table which manages those ids. Directly after the process I remove the lock id. A User can only start the process, when the lock id is 0. Don`t forget a separat unlock function, if there is a system crash during the process.
2. For forms in the edit mode I grant the user a maximum working time f.e. 5 min. If the user clicks submit after this time he will get an timeout error and the form is not updated. For this reason I have a time field in the table. Additional I write the user ID in the record of the table which is processed. When the user submits before timeout I remove this entry. Opens a user the form I check if there is a value as lock id in the table, if that is I check for timeout. Is the current time bigger than the time stored in the table plus the 5 min. I replace the lock id by the user id of this user and store the current time as new start time.
In the worst case no form is longer locked as 5 min. I think that is bearable.
3. In an editable grid I lock the whole table, if there is not any parent record. Same procedure as told before.
I think there are other possibilities more comfortable if you use another database engine. f.e. innoDB.

Hope I could help you.
Gerhard
View profile  Send private message
michaelwpayton

Posts: 18
Posted: 03/17/2007, 5:42 AM

Thanks for the interesting reply.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.