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.
Oracle ODP.NET - check if user already logged in??
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Oracle ODP.NET - check if user already logged in??
Do they log directly into the DB or do they have an app which opens up which does the loggin on
- Spoiler (show)
Re: Oracle ODP.NET - check if user already logged in??
An ASP.NET app is used.RuadRauFlessa wrote:Do they log directly into the DB or do they have an app which opens up which does the loggin on
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...
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Oracle ODP.NET - check if user already logged in??
Is it an inhouse appshiv wrote:An ASP.NET app is used.
- Spoiler (show)
Re: Oracle ODP.NET - check if user already logged in??
yeah.RuadRauFlessa wrote:Is it an inhouse appshiv wrote:An ASP.NET app is used.
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Oracle ODP.NET - check if user already logged in??
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.
- Spoiler (show)
Re: Oracle ODP.NET - check if user already logged in??
Modifying the db is unnecessary, in fact my DBA will have 100's of questions!!!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.
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.
-
- Registered User
- Posts: 20576
- Joined: 19 Sep 2003, 02:00
- Location: Bloodbank
Re: Oracle ODP.NET - check if user already logged in??
Nope. the best way is to limit it from the application side.
- Spoiler (show)