Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Why can not I get user's IP using owa_sec.get_client_ip?

Why can not I get user's IP using owa_sec.get_client_ip?

From: <sj_at_china.pages.com.cn>
Date: 1998/03/29
Message-ID: <6fkp98$hm0$1@nnrp1.dejanews.com>#1/1

Hello :

  I am using Oracle web server 3.0 and oracle 7.3.3 to develop a web based administration system

  I am now facing such a problem: in my program which deal with the user request , want to record where the request comes , so I use the procedure owa_sec.get_client.ip to get the ip address of user . but I found that :

  1. If I use this function before the normal process which start with select ... for update statement ,the transanction will NOT see the result of a commited transanction( before this transaction ) who has change the row which will be locked by this transaction. So the data consistace is destructed .

    The sequence is like the following:

    client_ip := owa_sec.get_client_ip ;

    ipaddr := to_char(client_ip(1)) || '.' ||
             to_char(client_ip(2)) || '.' ||
             to_char(client_ip(3)) || '.' ||
             to_char(client_ip(4)) ;


    select ... for update ; <--- will always succeed

    if ... then

      update ..... (record the client ip address)

     end if ;

  2. If I use the function after all the update operation of tranction , the transaction will be done twice . all destruct the data consistence.

    Like the following:

    select .. for update;

    if ... then

      update ....
      update .... ( not record the client ip address)

    end if ;
    commit;

    client_ip := owa_sec.get_client_ip ;

    ipaddr := to_char(client_ip(1)) || '.' ||
             to_char(client_ip(2)) || '.' ||
             to_char(client_ip(3)) || '.' ||
             to_char(client_ip(4)) ;

     update ....  ( record the ip address ) <-- will cause the transaction
						 redo from the begining

   3. if I use the function before any database operation , which form a user
	interface form

       client_ip := owa_sec.get_client_ip ;
       ipaddr := to_char(client_ip(1)) || '.' ||
             to_char(client_ip(2)) || '.' ||
             to_char(client_ip(3)) || '.' ||
             to_char(client_ip(4)) ;

       htp.print...

      < form a html page>


       the system shows :

    Request Failed

>Error occured while accessing

        "/work/plsql/upd163.pasproc"
    at Sun Mar 29 13:44:21 1998

    OWS-05101: Execution failed due to Oracle error 1403
    ORA-01403: no data found
    ORA-06512: at "SJ.UPD163", line 766
    ORA-06512: at line 1

    PL/SQL Cartridge SERVICE: work
    PROCEDURE: upd163.pasproc

  PARAMETERS:



  USERID:
   sj
  OPERATETYPE:
   4
  PASSWD1:
   qqq
  PASSWD2:
   qqq
  PROXY:
   ddf
  OPERATOR:
   dd1
  SUB:
   confirm

    Why ? How can I do with the problem ?

  Each word will be highly appriciated !

  Jing Shen

  mail to: sj_at_china.pages.com.cn

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Sun Mar 29 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US