Welcome Guest, Not a member yet? Register   Sign In
Multi user application
#7

[eluser]WanWizard[/eluser]
Transactions are not really a solution for concurrency.

For ExiteCMS, we've developed a standard solution that is being built into our database update method.

For a table that needs concurrency protection, we add a column named 'last_updated', which contains the last update timestamp. When an update query is run by the update method, it adds 'WHERE last_updated = <last_update_timestamp>' to the query (the timestamp is retrieved with the other fields in the select to display the form).

If the result is that no records were updated, the record must have been updated by someone else (timestamp in the record doesn't match the one we retrieved earlier), and the code needs to take appropriate action.
If the record was updated, the last_updated field in the table was still the same as the one we retrieved, so it was unaltered in the time you were busy with the form.


Messages In This Thread
Multi user application - by El Forum - 07-15-2010, 02:57 PM
Multi user application - by El Forum - 07-15-2010, 03:39 PM
Multi user application - by El Forum - 07-15-2010, 03:42 PM
Multi user application - by El Forum - 07-15-2010, 03:49 PM
Multi user application - by El Forum - 07-15-2010, 04:06 PM
Multi user application - by El Forum - 07-15-2010, 07:15 PM
Multi user application - by El Forum - 07-16-2010, 02:50 AM
Multi user application - by El Forum - 07-16-2010, 03:18 AM
Multi user application - by El Forum - 07-16-2010, 06:40 AM
Multi user application - by El Forum - 07-16-2010, 04:07 PM
Multi user application - by El Forum - 07-17-2010, 04:18 AM
Multi user application - by El Forum - 07-17-2010, 04:29 AM
Multi user application - by El Forum - 07-17-2010, 05:06 AM
Multi user application - by El Forum - 07-17-2010, 05:09 AM
Multi user application - by El Forum - 07-17-2010, 05:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB