14 Replies Latest reply: Jan 29, 2013 10:58 PM by user5690975 RSS

    Killing Idle session from Oracle 6i forms!

    user5690975
      Dear All,

      I am trying to work around to exit the form or killing the session when there is no activity on my Oracle 6i form...

      I wrote the following good but not useful

      @ new-form-instance
      DECLARE
      Li_Pantalla Pls_Integer;
      Lt_Reloj_Id Timer;
      BEGIN

      Li_Pantalla := GET_WINDOW_PROPERTY (FORMS_MDI_WINDOW, WINDOW_HANDLE) ;
      message(Li_Pantalla);
      message(Li_Pantalla);
      WIN_API_SESSION.TIMEOUT_START_TIMER (Li_Pantalla) ;
      message(' 1 ' || Li_Pantalla);
      message(' 1 ' || Li_Pantalla);
      -- Find watch, if you delete it.
      Lt_Reloj_Id := Find_Timer ('TIEMPO_INACTIVIDAD');
      IF NOT Id_Null (Lt_Reloj_Id) THEN
      DELETE_TIMER (Lt_Reloj_Id) ;
      END IF;
      -- Create a watch and repeats every second starting from scratch.
      Lt_Reloj_Id := Create_Timer ('TIEMPO_INACTIVIDAD', 1000, REPEAT);
      EXCEPTION
      WHEN OTHERS THEN
      NULL;


      @ when-timer-expired

      DECLARE
      Lt_Reloj_Id Timer;
      Ln_Inactividad Number;
      Lv_Usuario VARCHAR2 (80);
      Lv_Clave VARCHAR2 (80);
      Lv_Base VARCHAR2 (80);
      Ln_Valida Number;
      Li_Pantalla Pls_integer;

      Begin

      Lt_Reloj_Id := Find_Timer ('TIEMPO_INACTIVIDAD');
           IF NOT Id_Null (Lt_Reloj_Id) THEN
                     Ln_Inactividad := Win_api_session.Timeout_Get_Inactive_Time;
      IF Ln_Inactividad >= 10 THEN
                          MESSAGE ('The end of your session'); SYNCHRONIZE;
                          LOGOUT;
                          Win_API_Session.timeout_delete_timer;
                          DELETE_TIMER (Lt_Reloj_Id) ;
                     END IF;
           END IF;

      EXCEPTION
      WHEN OTHERS THEN
      EXIT_FORM (NO_VALIDATE) ;
      END;


      Request you to through some light on the same
        • 1. Re: Killing Idle session from Oracle 6i forms!
          O.Developer
          I Think you should refer below link to address easily


          http://www.erpstuff.com/forums/topic.asp?TOPIC_ID=2798
          • 2. Re: Killing Idle session from Oracle 6i forms!
            user5690975
            Thanks ..

            I tried but no result

            any other work around
            • 3. Re: Killing Idle session from Oracle 6i forms!
              sb92075
              user5690975 wrote:
              Dear All,

              I am trying to work around to exit the form or killing the session when there is no activity on my Oracle 6i form...
              WHY?

              Idle client consumes no significant resource.
              • 4. Re: Killing Idle session from Oracle 6i forms!
                user5690975
                I am having around 700 users they fetch the records and forget to release and do their other activity.
                What i want if no activities are happening on the fetched record either exit the form or kill the session.. so that due to this other users will not get affected
                • 5. Re: Killing Idle session from Oracle 6i forms!
                  yoonas
                  Hi,

                  What about using database profile option idle_time? So that oracle will take care of your users idle sessions.

                  Regards
                  Yoonas
                  • 6. Re: Killing Idle session from Oracle 6i forms!
                    user5690975
                    No.. i tried that giving 10min ideal time at oracle profile level but didn't work at applicaiton.

                    Today I came across other issue with the following query

                    SELECT DISTINCT cust_acc FROM ibsoifc.IBS_X_T_DEVIATIONS
                    WHERE cust_acc = :b1

                    Above query is on post-query and pre-text-item trigger when the user is clearing the block and setting ideal still i am getting the lock on the above table......any working around for this
                    • 7. Re: Killing Idle session from Oracle 6i forms!
                      yoonas
                      Hi,

                      How is the user clearing the form ?

                      In post query if you set any block items values(ex :block.item:='something') form will consider as change in block and acquire a lock for the particular table your blcok is based on. so check when what is the status of the form when user clears the block.

                      Regards
                      Yoonas
                      • 8. Re: Killing Idle session from Oracle 6i forms!
                        user5690975
                        any more ideas....

                        a form have pre-text-item and post-query the following query to set the visual attribute

                             declare
                                       V_cust_NO varchar2(25);
                             BEGIN
                                       select distinct customer into V_cust_NO from tab_T_DEVIATIONS
                                       WHERE BPREF_NO = :blockname.cust_NO;
                                       Display_Item( 'NAVIG.ITEM565','VA_AGR');
                             EXCEPTION WHEN OTHERS THEN
                                       Display_Item( 'NAVIG.ITEM565','VA_TEXT');
                             END;

                        the above query is creating a lock on a table...even if we clear the block.. the block is getting release once i come out of the form
                        This form is the query screen were my users never come out of this form...please give some idea on the this issue

                        Edited by: user5690975 on Dec 25, 2012 2:20 AM
                        • 9. Re: Killing Idle session from Oracle 6i forms!
                          yoonas
                          Hi,

                          You have only only one block on the form , if there are more blocks may be user has already started some modification on other items which you are not clearing could stop form from releasing the lock.

                          If you are using clear blcok try using clear_form with no_commit or no_validate.

                          If the form is called from another form use call_form with query_only option so that forms will not allow user to modify .


                          Regards
                          Yoonas
                          • 10. Re: Killing Idle session from Oracle 6i forms!
                            user5690975
                            Thanks Yonus,

                            I am using Clear_Form(no_validate) still lock is happen...Today i deployed the following code and lets see how this one behave

                            declare
                                           V_cust_NO varchar2(25);
                                           cursor c1(bpref varchar) is
                                                          select distinct cust_NO from cust_DEVIATIONS
                                           WHERE cust_NO = bpref;
                                           
                                 BEGIN
                                                for i in c1(:block.cust_NO) loop
                                           if c1%notfound then
                                                V_cust_NO:=i.cust_no;
                                                     Display_Item( 'NAVIG.ITEM565','VA_TEXT');
                                           else
                                                     Display_Item( 'NAVIG.ITEM565','VA_AGR');
                                                end if;
                                           end loop;
                                           
                                      --     Display_Item( 'NAVIG.ITEM565','VA_AGR');
                                 EXCEPTION WHEN OTHERS THEN
                                           Display_Item( 'NAVIG.ITEM565','VA_TEXT');
                                 END;

                            Do you think this above way will help or what?
                            • 11. Re: Killing Idle session from Oracle 6i forms!
                              yoonas
                              Hi,

                              If you doubt above code comment the code, run two sessions of forms and see if that is creating the issue. i dont think so

                              How are you clearing your form, Do you have a button which user will click when he/she doen't want to use the form or how?

                              Is this the first form user sees after login or is it called from other form, if its called from other form and users are only using forquery you can try the method i suggested in previous post.

                              Regards
                              Yoonas
                              • 12. Re: Killing Idle session from Oracle 6i forms!
                                user5690975
                                Thanks Yonus.

                                This is a query form only where the customer service people view the information about the customer... Yes I have one button from where the users clear the screen or smiple they press f8 key...

                                This is not the first form after the login screen...login screen takes us to the menu form from there the user will select this form.

                                As you said previous solution ...are you talking abt the one what i posted or yours?
                                • 13. Re: Killing Idle session from Oracle 6i forms!
                                  yoonas
                                  >
                                  If the form is called from another form use call_form with query_only option so that forms will not allow user to modify .
                                  >

                                  I was talking about my own post. If not possible with above disable all insert update options on form, make sure you don't have anyother explicit updates,inserts or deletes on the table .

                                  Did you see if you have any sqlplus(or any other tool) session open that is actually locking the table for update?
                                  • 14. Re: Killing Idle session from Oracle 6i forms!
                                    user5690975
                                    Thanks Younus once again,

                                    This form is only for view not for any DML operations. I seeing update allow=y now i made it to n.. I will deploy this and crosscheck