Problem solve Get help with specific problems with your technologies, process and projects.

Holding a record lock until a user is working on that record

In reference to your response on Record locking in ADO.NET, I would say this might hold true for most of cases, but let us take a scenario where I want to explicitly lock a record, and hold the lock till that user is working on that record. Can you please help me in this, be it Oracle or SQL Server?
I strongly advise against (and most DBA guys will also) to provide locks that depend on user interaction. It kills scalability (if not of the database, certainly of your application), and you will find yourself in a nightmare when an increasing number of users can't work because some other has left his work undone and gone to lunch, or worse, his workstation (or worse, YOUR application) crashed and now the lock mark will never cleared.

If you decide to go on (you have been warned), the simple approach (and the only one, I'm afraid) is for you to add a bit field to your 'lockable' tables and set it through application logic. There's no RDBMS built-in mechanism for this. Then your application just has to check this flag and warn the user.

Dig Deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.