Record Locking necessary ?

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Record Locking necessary ?

Postby Bernd.N » Tue Mar 15, 2016 3:59 pm

When having a person's overtime account (or any other account), I wonder if there are situations where a locking of the record would be necessary which holds the account.
In our case the time account is part of the person's record, field ps_time_account (Numeric). It holds the number of overtime hours.

As long as the person record is resting untouched in the table, any time bookings would come in as consecutive UPDATE commands, and as the SQL server processes all updates one after the other, everything should be alright.

However what happens if a HR employee edits the person record itself, which would mean - as far as I know - that a copy of the record goes into the "foundset record", including the field ps_time_account.

Is at the end, when saving the record, the complete "foundset record" copied back into the original record with one large UPDATE command for all fields, or does the SQL-UPDATE contain only those fields that got changed?
Because if the first case would be true, a prior locking would be necessary in order to prevent data inaccuracy, as in the meantime the ps_time_account could have been changed by time bookings from another user.
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 497
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: Record Locking necessary ?

Postby Bernd.N » Fri Mar 18, 2016 1:54 pm

Let me ask it this way: Does anyone use record locking in a Servoy/SQL-environment?
If yes, I would be interested about the circumstances (the reason) and the how-to, because I wonder if it is needed in special cases.
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 497
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Programming with Servoy

Who is online

Users browsing this forum: joe26 and 3 guests