2 Replies Latest reply: Dec 30, 2011 12:32 AM by lunicon RSS

    olite data subsetting & VPD ?

    lunicon
      I already have data subsetting throw VPD (Virtual Private Database)

      How i can set session context from olite subset parameters?

      For now I see only one solution:
      create publication item with subset
      select * from dual mypackage.setcontext(:userid) = 0
      with minimum width = W_SET
      and set width > W_SET to other items;
      not tested yet..

      Only one problemma, synchronization works in one session?
      Someone do this already, and knows a better solution?

      ---
      One week passed and no one said that the weight is taken into account only in insert/update/delete :(
      probably all been celebrating the —Āhristmas, new year....

      now i trying to use dml callbacks
      Edited by: lunicon on 28.12.2011 21:13
        • 1. Re: olite data subsetting & VPD ?
          lunicon
          I try to create package CUSTOMIZE as in documentation, restart server, but it never been called. What's wrong?
          CREATE OR REPLACE PACKAGE MOBILEADMIN.CUSTOMIZE AS 
              PROCEDURE NullSync (clientid varchar2, isNullSync boolean); 
              PROCEDURE BeforeProcessApply; 
              PROCEDURE AfterProcessApply; 
              PROCEDURE BeforeProcessCompose; 
              PROCEDURE AfterProcessCompose; 
              PROCEDURE BeforeProcessLogs; 
              PROCEDURE AfterProcessLogs; 
              PROCEDURE BeforeClientCompose(clientid varchar2); 
              PROCEDURE AfterClientCompose(clientid varchar2); 
          END; 
          dont know howto make hidden text on forum..
          ---
          Got it:
          clog: MGP.callBoundCallBack: FINEST: GENERAL: CUSTOMIZE package does not exist or is invalid.
          MISSING OR INVALID ::     CUSTOMIZE.BeforeSyncMapCleanup();

          Bad example in documentation 2.7.1.12
          Edited by: lunicon on 29.12.2011 21:56
          • 2. Re: olite data subsetting & VPD ?
            lunicon
            VPD works!

            For example, i use external authentication using my table users and update context from mobile server username
            CREATE OR REPLACE PACKAGE BODY CUSTOMIZE
            AS
                 PROCEDURE NullSync(clientid varchar2, isNullSync boolean)
                 IS
                 usrid NUMBER;
                 BEGIN
                      BEGIN
                           SELECT userid INTO usrid FROM MYUSER.appuser WHERE UPPER(login) = UPPER(clientid);
                      EXCEPTION
                           WHEN NO_DATA_FOUND
                      THEN
                           usrid := NULL;
                      END;
            
                      MYUSER.B2B_CONTEXT.set_context(clientid, usrid);
                 END;
            ....
            turned a great monologue :)
            happy holidays!