[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 598
  • Last Modified:

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.

THanks,

B
0
cyimxtck
Asked:
cyimxtck
  • 2
1 Solution
 
kretzschmarCommented:
hi,

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 ;-)
0
 
cyimxtckAuthor Commented:
What if there are multiple sessions opened by the same user?  (i.e. 5 browser windows with the same login credentials)

Thanks,

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

meikl ;-)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now