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

Posted on 2008-11-03
Last Modified: 2013-12-07
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.


Question by:cyimxtck
    LVL 27

    Expert Comment


    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 ;-)

    Author Comment

    What if there are multiple sessions opened by the same user?  (i.e. 5 browser windows with the same login credentials)


    LVL 27

    Accepted Solution

    well in this case different connections are used, each connection do have its own session
    (the user doesn't matter in this case)

    meikl ;-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
    This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now