SELECT FOR UPDATE in a ref cursor from VB.NET application...

I have a .NET application that I want to use row level locking in Oracle.  There are about 300 users that can simultaneously access the application that I have built.  If each person tries to access a given issue number I want them to be denied access with raise_application_error("issue already being modified").

How do I create this?

The transaction would have to be inside of .NET I am guessing?  If it is in .NET how can I SELECT FOR UPDATE when the update is taking place in a separate method?

Any thoughts would be great.

Trial and error would be horrific in terms of time taken to build a prototype.

Please give me your thoughts.


Who is Participating?
kretzschmarConnect With a Mentor Commented:
well in this case different connections are used, each connection do have its own session
(the user doesn't matter in this case)

meikl ;-)

well, no .NET experience, but usual any transaktion-object is just a wrapper for the DB-transaktion, which is started with the db-session.

of course you can use the for update-clause. the lock on the record persists as long as the transaktion is not commited or rollbacked (or the session becomes invalid, is killed).

btw. it doesn't matter which method selects and which does the real update. you have only to care, that all is using the same connection (which was not closed and reopened between select and update).

hope this helps

meikl ;-)
cyimxtckAuthor Commented:
What if there are multiple sessions opened by the same user?  (i.e. 5 browser windows with the same login credentials)


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.