I really have to question why you need to lock the records in the first place. If you are entering new purchase orders, why do you need to lock? and if you are editing a purchase order, is it because you only want one person to be able to edit the order at a time?
With that said, I did develop a system that dealt with files that could be read but only edited by one person at a time. This was in SQL Server. When a user went into edit mode on a file, I wrote out the file number and the user id to a table. When they went out of edit mode (after a save) the record was deleted.
There were a few rules:
When the user logged into the system, any records for that user were automatically deleted (if they remained).
Whenever a user tried to edit a file, this table was checked to see if someone already 'had' the file. If they did, then a further check was made (sp_who) to see if this user was currently logged in. If they weren't, their lock on the file was released and the new person got it.
There was no actual record locking per se. It was all managed by logic. Any user could read the file, it was only when they tried to edit that a check was made.
This system was in SQL Server 6.5 which has page locking only, so locking a record would also lock any other records on that page. Plus locks use up lots of resources.
>That will be a great solution, but this program is for Purchase Order, and an order could take 1 or 2 or even more hours to complete...so, i got no way to implment a timeout to the lock issue.
>
>But thanks anyway
>Ricardo Martins
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement