Z
Z
ZhanD2019-09-18 08:22:55
Oracle
ZhanD, 2019-09-18 08:22:55

How to kill an active oracle session launched from a .Net web application?

Hello.
Introductory:
DB: Oracle 11;
Web application: ASP.Net - deployed on IIS 7;
Connection via Oracle.DataAccess.
I have a system that generates dozens of dynamic reports with a lot of data.
There is a lot of logic in the reports and they are well optimized, and in general they show good execution speed.
The problem is that the system is used by about 15 people. And each of them simultaneously opens several tabs and starts generating queries, which in turn reduces the performance of the database server. Further, half of them, after waiting 5-20 minutes and not waiting for the data to appear on the interface, close the tab and immediately open a new one.
As a result, from the database side I see 50-100 active sessions launched from the application.
Question:
1. As soon as the tab is closed without having time to receive the data, the data generation procedure is automatically killed on the DB side?
2. Or continues the execution of the request to the bitter end, eating off resources?
3. In case 2, is it possible to find out what SID this process has and kill it forcibly?
4. Is it possible to tweak any settings in IIS?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2019-09-18
@ZhanD

1. 2. - depends on how the application logic is implemented.
3. To identify the session, the application can fill in the client_identifier field in v$session:

select sid, serial# from v$session where client_identifier = 'имя пользователя'

S
shai_hulud, 2019-09-18
@shai_hulud

There are two suggestions:
1) Record the fact of the beginning of the report creation in HttpContext.Session and when refreshing the page/going to the reports, "continue" to wait for the started result.
2) Record the fact that the report was created in HttpContext.Session and send from the browser every N seconds that the user is waiting for a report, as soon as such messages have not arrived for N * 2 seconds, kill the connection / request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question