Thursday, June 7, 2012

Clear Table records after startup database


If user does not logout properly / kill task / services restarted then record of that user will present in tblrklogindetails table.

We can create trigger that will delete all records if database service will be restarted

create or replace trigger tg_clear_logindetails
    after startup
     on database
  declare
     j   integer;
    pragma autonomous_transaction;
  begin
    dbms_job.submit (j,  'begin execute immediate ''truncate table ldbo.tblrklogindetails''; end;');
   commit;
 end tg_clear_logindetails;
 /


If there is no records in the table then following Error message will popup.

Please change this message to some user friendly message

“Session is Disconnected from a server. Please Login again”

Or something else



In web application , client makes connection with server using IIS manager.

1)      User login into rk application and fire report
2)      Oracle service is restart in between. Oracle Not connected Error has started because connection is break between client and server.
3)      Error is coming until we have not logout and login again into application.
4)      Iisreset help to reconnect client server without logout application.


Resolution

When database is shutdown, application should automatically shutdown when showing oracle not connected .

Tblrklogindetails records should be clear.

No comments:

Post a Comment

Followers