Link to home
Start Free TrialLog in
Avatar of miyahira
miyahiraFlag for Peru

asked on

Oracle sessions and processes generated by a .NET web app

Our .NET web app uses ODP.NET for connections and its Oracle User for connecting to database is "webuserOracle". That web app always close connections and dispose connections.

However, on our Oracle 10g database, we see that sessions and processes values of Oracle User "webuserOracle" is always high, as they woudn't close or die.

We have decided to set up on Oracle profile for "webuserOracle" in order to limit the connect time up to 5 minutes.

CREATE PROFILE profile_webuserOracle LIMIT CONNECT_TIME 5;

ALTER USER webuserOracle PROFILE profile_webuserOracle;

Open in new window

Question:

For a web app, limiting connection to 5 minutes, means that the user could interact, say, 2 hours with the web app. The limit of 5 minutes is only for events triggered (like clicking a button) to connect to database. 5 minutes for everything that happened between Con.Open and Con.Dispose:

Dim con As OracleConnection = oraConexion()
con.Open()
''' There'll be a limit of 5 minutes to run the code here
con.Close()
con.Dispose()

Open in new window


A Session in Oracle is allways an open and close connection?
SOLUTION
Avatar of Helena Marková
Helena Marková
Flag of Slovakia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of miyahira

ASKER

Thanks for your responses, but I don't undertsand yet the difference between a session and connection for a web application.

For a web application, what is an Oracle session?

Example:
User access through login.aspx and then autenticate it against database.
Then go to WebForm1.aspx, fill data and save.
Then go to WebForm2.aspx and check out some reports.

A database session would start when user make first connection in Login.aspx? After that, he/she will make a number of connections to database in the same session that started at Login.aspx?

Example of connection:
Dim con As OracleConnection = oraConexion()
con.Open()
''' Code to run
con.Close()
con.Dispose()

Open in new window


Or an Oracle session is a connection as described?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A user interacting with a web app will make tons of connections to database: to login user, to populate comboboxes, to fill forms, to validate input, etc. Those connections and queries to database will last less than 5 minutes.

If an Oracle session is a connection, then it doesn't matter if I setup profile to limit connect time to 5 minutes or 1 minute.

Example:
- Web app makes a connection to database to authenticate user. Open, run code, close and dispose connection. (less than 5 minutes).

- Web app makes a connection to database to fill comboxes. Open, run code, close and dispose connection. (less than 5 minutes).

- Web app makes connection to database to validate a textbox input. Open, run code, close and dispose connection. (less than 5 minutes).
 
and so on...
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial