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 -> Web Toolkit progam, javascript and Netscape application error

Web Toolkit progam, javascript and Netscape application error

From: Mark S. Reichman <reichmanm_at_rl.af.mil.>
Date: 19 Oct 99 13:31:43 GMT
Message-ID: <380c72bf.0@nntp2.borg.com>


I have a plsql web toolkit procedure. It contains javascript and html. The procedure compiles fine and works great. It dispays inside a netscape window and renders an html form populated with oracle database data. It sets a timeout and requerys the database every 90 seconds redrawing the form populated with current data. Heres the rub... Since I have a few different offices that require the same functionality I have copied this procedure 4 times under different names in the same package. I dont see a problem with this. When I try to run two or more of these differently named procedures at the same time each inside independently name Netscape windows, I get a Netscape application error. Like I said, as long as I only run one of the procedures it works fine. It must be some sort of memory violation thing? I have not tried this in MS Explorer. I think I will go do that now. Thanks for any help or thoughts/improvements.

Wild guesses to the possible problem:

  1. Since the code in each procedure is practically identical except for the "where clause", are the gloabal javascript variables of the same name interfering with each other even though they are in different windows?
  2. Do I need to prefix something in this code with a "this" object.
  3. Are the timers colliding somehow?
  4. Is there a limit to the number of sockets available to netscape? If all of these timers make a call to the database at the same time does netscape choke?

procedure maint_db_monitor(ship_chk in varchar2, job_chk in varchar2, req_chk in varchar2) is
begin
  declare

    cnt_ship number;
    cnt_job  number;
    cnt_req  number;

  begin
    select count(ship_id)
    into cnt_ship
    from shipping_info
    where lgse_sig_ops is not null and lgm_sig_ops is null and (status = 'CONTRACT MAINTENANCE' or status = 'WARRANTY REPAIR');

    select count(lgm_id)

      into cnt_job
      from lgm_jobs
     where lgm_accept_date is null and canceled_date is null and job_complete_date is null;

    select count(req_id)
      into cnt_req
      from rcm_info
     where canceled_date is null and lgm_accept_name_ops is null;

 htp.p('

<HTML>
<HEAD>
<TITLE>Maintenance Database Monitor</TITLE>
<script language="javascript1.3">

var timerid;

var is_ship_checked;
var is_job_checked;
var is_req_checked;


function set_values()
{
  if (document.monitor.ship_chkbx.checked == true)     is_ship_checked = "checked";
  else
    is_ship_checked = "";   

  if (document.monitor.job_chkbx.checked == true)     is_job_checked = "checked";
  else
    is_job_checked = "";   

  if (document.monitor.req_chkbx.checked == true)     is_req_checked = "checked";
  else
    is_req_checked = "";
}

function turn_on()
{

   document.monitor.onoff.value = "ON";    set_values();
   top.window.location.href = "lmcaforms.maint_db_monitor?ship_chk="+is_ship_checked+"&job_chk="+is_job_checked+"&req_chk="+is_req_checked; }

function set_timer()
{
  timerid = setTimeout("turn_on()",90000); }

function turn_off()
{
  document.monitor.onoff.value = "OFF";   clearTimeout(timerid);
}

</script
</HEAD>
<BODY bgcolor="#BBBBB" onLoad="set_timer();">
');    

htp.p(
'<form name="monitor"> '||
'<font face="courier new" size="1"><b>On/Off</b>&nbsp</font>'||
'<font face="courier new" size="1"><INPUT type="text" name="onoff" value="ON" size="4"></font><br>'||
'<font face="courier new" size="1">&nbsp&nbsp<b>Ship</b>&nbsp</font>'||
'<font face="courier new" size="1"><INPUT type="text" name="ship" value="'||cnt_ship||'" size="4"></font>'||
'<font face="courier new" size="1"><INPUT type="checkbox" name="ship_chkbx" onClick="set_values()" '||ship_chk||'></font>'||
'<img src="/web_html/pics/speaker.gif" align="top" height=18 width=18 border=0><br>'||
'<font face="courier new" size="1">&nbsp&nbsp&nbsp<b>Job</b>&nbsp</font>'||
'<font face="courier new" size="1"><INPUT type="text" name="job" value="'||cnt_job ||'" size="4"></font>'||
'<font face="courier new" size="1"><INPUT type="checkbox" name="job_chkbx" onClick="set_values()" '||job_chk||'></font>'||
'<img src="/web_html/pics/speaker.gif" align="top" height=18 width=18 border=0><br>'||
'<font face="courier new" size="1">&nbsp&nbsp&nbsp<b>Req</b>&nbsp</font>'||
'<font face="courier new" size="1"><INPUT type="text" name="req" value="'||cnt_req ||'" size="4"></font>'||
'<font face="courier new" size="1"><INPUT type="checkbox" name="req_chkbx" onClick="set_values()" '||req_chk||'></font>'||
'<img src="/web_html/pics/speaker.gif" align="top" height=18 width=18 border=0><br><br> '||
'<font face="times new roman" size="1"><center><INPUT type="button" name="On" value="On" onClick="turn_on();"></font>'||
'<font face="times new roman" size="1">&nbsp<INPUT type="button" name="Off" value="Off" onClick="turn_off();"></font></center>'||
'</form>');

if (cnt_ship > 0 and  ship_chk = 'checked') or
   (cnt_job > 0  and  job_chk  = 'checked') or
   (cnt_req > 0  and  req_chk  = 'checked') then
htp.p('
<EMBED 	name="uh_oh"     src="/web_html/sounds/uh_oh.wav"     loop="1" autostart="true" mastersound hidden="true" volume="10"></embed>

<script language="javascript">
window.focus();
</script>
');
end if;

htp.p('
</BODY>
</HTML>
');
end;
end; Received on Tue Oct 19 1999 - 08:31:43 CDT

Original text of this message

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