1 PACKAGE BODY ASG_NOTIFY as
2 /* $Header: asgnotb.pls 115.8 2001/06/04 15:14:29 pkm ship $*/
3 -- Description
4 -- ASG_Notify.
5 -- This package is a debuging / logging package that allows a developer to
6 -- Error, logging, and information messages real time.
7 --
8 -- In order to see the logged information real time, the developer must run
9 -- oracle.apps.asg.util.SqlLogger. SqlLogger is a standalone java application
10 -- that retirves the output from ASG_Notify.
11 --
12 -- HISTORY
13 -- 02-feb-99 D Cassinera Created.
14
15 m_ses_info varchar2 (200);
16
17 /*==========================================================================
18 Read_Pipe
19 Reads a message from the pipe
20 ===========================================================================*/
21 Function Read_PIPE RETURN varchar2
22 IS
23 V_STATUS INTEGER;
24 ret integer;
25 text varchar2(32000);
26 begin
27 ret := 0; /* assume ok */
28 V_STATUS := DBMS_PIPE.RECEIVE_MESSAGE ('MIDDLE_TIER_MTS_CONTROL');
29 if (V_STATUS = 0 ) then
30 DBMS_PIPE.UNPACK_MESSAGE (text);
31 else
32 ret := v_status;
33 end if;
34 return text;
35 exception
36 when others then
37 /* This package is a debuging package therefore it should not raise any execptions */
38 return null;
39 end Read_PIPE;
40 /*==========================================================================
41 send_mesg
42 Sends a message to another session
43 ===========================================================================*/
44 FUNCTION SEND_MSG(text in varchar2, location varchar2) return number
45 IS
46 begin
47 Send_Message (text , location );
48 return 0;
49 end SEND_MSG;
50
51 /*==========================================================================
52 send message
53 Sends a message to another session
54 ===========================================================================*/
55 Procedure Send_Message(text IN varchar2, location varchar2) is
56 V_STATUS INTEGER;
57 v_user varchar2(20);
58 --v_ses_info varchar2 (200);
59
60 begin
61 -- SELECT ' '||MACHINE|| ' ' ||PROGRAM||' ' INTO V_SES_INFO FROM V$SESSION WHERE AUDSID = USERENV('SESSIONID') and rownum = 1;
62 -- SELECT MACHINE|| ' ' INTO V_SES_INFO FROM V$SESSION WHERE AUDSID = USERENV('SESSIONID') and rownum = 1;
63 DBMS_PIPE.PACK_MESSAGE (to_char (sysdate,'MMDD HH24:MI.SS')||' '||user||' '||m_SES_INFO||' '||location||' ' || text);
64 V_STATUS:=DBMS_PIPE.send_message ('MIDDLE_TIER_MTS_CONTROL',1);
65 exception
66 when others then
67 /* This package is a debuging package therefore it should not raise any execptions */
68 null;
69 end Send_Message;
70
71 /*==========================================================================
72 Stop
73 Sends a disconnect signal to the client if any.
74 ===========================================================================*/
75 Procedure STOP is
76 V_STATUS INTEGER;
77 v_user varchar2(20);
78 v_ses_info varchar2 (80);
79
80 begin
81 -- SELECT MACHINE|| ' ' ||PROGRAM||' ' INTO V_SES_INFO FROM V$SESSION WHERE AUDSID = USERENV('SESSIONID') and rownum = 1;
82 DBMS_PIPE.PACK_MESSAGE ('STOP '||to_char (sysdate,'MMDD HH24:MI.SS')||' '||user||' '||m_SES_INFO);
83 V_STATUS:=DBMS_PIPE.send_message ('MIDDLE_TIER_MTS_CONTROL',1);
84 exception
85 when others then
86 /* This package is a debuging package therefore it should not raise any execptions */
87 null;
88 end STOP;
89
90 begin
91 SELECT ' '||MACHINE|| ' ' ||PROGRAM||' ' INTO m_SES_INFO FROM V$SESSION WHERE AUDSID = USERENV('SESSIONID') and rownum = 1;
92
93 END ASG_NOTIFY;