Home » SQL & PL/SQL » SQL & PL/SQL » Marked killed sessions and forms not terminated (Forms 6i Oracle 10g)
Marked killed sessions and forms not terminated [message #323959] Fri, 30 May 2008 02:54 Go to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hi everyone,

I am implementing some monitoring job to automatically close sessions of users according to some business rules (legal time of conenction exceeded for example). My logic is ok so far and the "alter system kill session" part too. I am running this job under a username with dba role and alter system privilege granted directly.
However, whenever I test this job, I always end up with the entry corresponding to this session in v$session marked as 'KILLED' while the Forms is still running. What I want to implement is a mechanism that will also close the form immediately. Note that I issue the kill statement with an execute immediate as below:
 execute immediate('ALTER SYSTEM KILL SESSION '''||vsid|| ', '||vserial|| ''''); 

Can someone advise please.

Regards,
Didier
Re: Marked killed sessions and forms not terminated [message #323960 is a reply to message #323959] Fri, 30 May 2008 03:04 Go to previous messageGo to next message
Michel Cadot
Messages: 64106
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The session is killed, nothing can be done in the database as soon as your user will accessed it he will receive an error saying his session is killed.
So where is the problem?

Regards
Michel
Re: Marked killed sessions and forms not terminated [message #323964 is a reply to message #323959] Fri, 30 May 2008 03:06 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I suspect that you're re-inventing the wheel.
Have you looked at [url=http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_611a.htm#SQLRF01310
Profiles[/url]?

As to killing the form:
Your job runs on the database server. The Form runs on a client, somewhere in the world.
The Db doesn't know where the client is, and almost certainly wouldn't be able to connect to it anyway.

If you can amend all the forms. you could add a Timer to them to continually check that their session is still alove, but if you have a lot of users, this could significantly increase the load on your server.
Re: Marked killed sessions and forms not terminated [message #324009 is a reply to message #323964] Fri, 30 May 2008 04:52 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Ok, I think I get the difference. In fact I asked this question because I use 2 mechanisms: 1 the logon trigger for filtering access and 2 the job. In the first, it's the form which initiates the call to the stored procedure, and eventually users get kicked with a raise_application_error which gives them a nice message explaining what was happening to them before the kick-out.
But in the second case, it's a job that is running and is just selecting from v$session these users who are in for a kick-out and in fact there's no way of coming back to the concerned Forms.
So you guys confirm me that there's no way of communicating with the end-user to , at least, let him know what's happening (except for that timer thing). Ok then no prob. anyway I also cater for logging these events so they'll just have to query with their DBA.

thanks a lot.
Didier
Re: Marked killed sessions and forms not terminated [message #324011 is a reply to message #324009] Fri, 30 May 2008 04:54 Go to previous message
Michel Cadot
Messages: 64106
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No way.

Regards
Michel
Previous Topic: How to remove not null constraint from a column
Next Topic: NUMBER OF DAYS BETWEEN DATES
Goto Forum:
  


Current Time: Mon Dec 05 03:05:40 CST 2016

Total time taken to generate the page: 0.09355 seconds