Oracle ODP.NET - check if user already logged in??

Get help on databases - MySQL, Oracle, Access, etc.
Post Reply
shiv
Registered User
Posts: 497
Joined: 26 Mar 2007, 02:00
Contact:

Oracle ODP.NET - check if user already logged in??

Post by shiv »

A user must only be logged on once.
The problem is that many (stupid) users log in as the same user, causes problems.
I want to check if a user is already logged in to the database.
How do i do this??
Must be some function available!!
Googled and found nothing helpful.

Any help appreciated.

Tx.
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: Oracle ODP.NET - check if user already logged in??

Post by RuadRauFlessa »

Do they log directly into the DB or do they have an app which opens up which does the loggin on :?:
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
shiv
Registered User
Posts: 497
Joined: 26 Mar 2007, 02:00
Contact:

Re: Oracle ODP.NET - check if user already logged in??

Post by shiv »

RuadRauFlessa wrote:Do they log directly into the DB or do they have an app which opens up which does the loggin on :?:
An ASP.NET app is used.
You know all that ODP.NET code used to connect...

Anyway I can't find that functionality in ODP.NET.
However, I did read about the V$SESSION view, which lists sessions.
Can use that!!!
So I can use a query like:
SELECT username FROM V$SESSION where username = :username

The only drawback is that this view is refreshed like every 5 minutes or so...
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: Oracle ODP.NET - check if user already logged in??

Post by RuadRauFlessa »

shiv wrote:An ASP.NET app is used.
Is it an inhouse app :?:
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
shiv
Registered User
Posts: 497
Joined: 26 Mar 2007, 02:00
Contact:

Re: Oracle ODP.NET - check if user already logged in??

Post by shiv »

RuadRauFlessa wrote:
shiv wrote:An ASP.NET app is used.
Is it an inhouse app :?:
yeah.
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: Oracle ODP.NET - check if user already logged in??

Post by RuadRauFlessa »

Then change the schema where your user logins is and add a logged in field. When the app starts and the user logs in set it to 1. Only attempt to log the user in if it is set to 0 otherwise give a login error saying multiple sessions is not allowed by a single user. Then when the app closes set it back to 0.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
shiv
Registered User
Posts: 497
Joined: 26 Mar 2007, 02:00
Contact:

Re: Oracle ODP.NET - check if user already logged in??

Post by shiv »

RuadRauFlessa wrote:Then change the schema where your user logins is and add a logged in field. When the app starts and the user logs in set it to 1. Only attempt to log the user in if it is set to 0 otherwise give a login error saying multiple sessions is not allowed by a single user. Then when the app closes set it back to 0.
Modifying the db is unnecessary, in fact my DBA will have 100's of questions!!!
This is just something I want to add to the application, it's not really top priority. The users are the problem!

Do you know of any other method, other than querying V$SESSION ?

Tx.
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: Oracle ODP.NET - check if user already logged in??

Post by RuadRauFlessa »

Nope. the best way is to limit it from the application side.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Post Reply