C
colin.steadman
I have an ASP page setup for doing maintenance jobs in Oracle.
Clicking a maintenance job spawns a new window (cut down to a small
size with Javascript) and the jobs runs.
Just before processing starts I output a message to the user in this
new window using a span (with an ID) using Response.Flush. This is to
let the user know that processing has started.
After the procedure has completed, I update the span message using its
ID with 'processed' or 'failed' accordingly.
So far so good!
The problem I have is that it only worked during development. This
seems to be because during development I used an example I picked up
from the ASPFAQ site to simulate database activity (ie a 15 second
delay) without actually doing anything using SQLServer:
sleep = 15
cn.open "Provider=sqloledb;Data Source=SVR;User Id=id;Password=pw"
cn.Execute "WAITFOR DELAY '00:00:" & sleep & "'"
With the above script everything worked great, and I could open three
or four different procedures and have them all running simultaneously.
Just what I wanted!
However when I switched to running the actual procedures Oracle (which
take a couple of minutes) I've found that it will only run one
procedure at a time. And while this one procedure is running I lose
communication with the parent window (the list of jobs) until the
procedure has finished.
Does anyone have any idea what might be causing this? The only
difference (apart from the SQL) between running in live (Oracle) and
simulating activity using SQL Server is the Provider. Could the Oracle
provider be missing something the SQL Server Provider has? And if so,
what might this be and can I get round it?
I've copied an example maintenance job page below.
TIA,
Colin
<%@Language=VBScript%>
<%Option Explicit%>
<%Session.LCID = 2057%>
<!-- #INCLUDE FILE="functions.asp" -->
<!-- #INCLUDE FILE="formatting.asp" -->
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
</head>
<body id="oBody"
style="filter
rogid
XImageTransform.Microsoft.Fade(duration=2);font-weight:bold;font-size:10pt;font-family:arial;tahoma">
<div id=messageToUserTxT
style="background-color:3996FF;color:ffffff;position: absolute; left:
0; top: 0;">
Processing Receipts...
</div>
<table height="100%" width="100%">
<tr>
<td align=center>Process Receipts</td>
</tr>
</table>
<%
Response.flush()
Dim cn
Dim sql
Dim arSQL()
Dim sleep
Dim testing
'Setup SQL
Redim arSQL(2)
arSQL(0) = "begin"
arSQL(1) = " Pacs_Inbound_Api.Process_Receipts;"
arSQL(2) = "end;"
'Setup connection
Set cn = Server.CreateObject("ADODB.Connection")
'RUN AS TEST OR LIVE?
testing = True
'testing = False
If testing Then
'TESTING
Server.ScriptTimeout = 20
sleep = 15
cn.open "Provider=sqloledb;Data Source=SVR;User Id=id;Password=pw"
cn.commandTimeout = 15
cn.Execute "WAITFOR DELAY '00:00:" & sleep & "'"
Else
'LIVE
Server.ScriptTimeout = 600
cn.open "Provider=OraOLEDB.Oracle;Data Source=SVR;User
Id=id;Password=pw"
cn.execute Join(arSQL,"")
End If
'Destroy SQL array
Erase arSQL
If Err.number <> 0 Or cn.Errors.Count <> 0 Then
response.write "<br>" & err.Description
%>
<script language=javascript>
// After setting Apply, changes to the oBody object
// are not displayed until Play is called.
oBody.filters[0].Apply();
oBody.style.backgroundColor="FFD3D3";
oBody.filters[0].Play();
messageToUserTxT.innerText = ' Processing failed! ';
</script>
<%
Else
%>
<script language=javascript>
// After setting Apply, changes to the oBody object
// are not displayed until Play is called.
oBody.filters[0].Apply();
oBody.style.backgroundColor="CEFFC2";
oBody.filters[0].Play();
messageToUserTxT.innerText = ' Processing complete! ';
</script>
<%
End If
cn.Close: Set cn = Nothing
%>
</body>
</html>
Clicking a maintenance job spawns a new window (cut down to a small
size with Javascript) and the jobs runs.
Just before processing starts I output a message to the user in this
new window using a span (with an ID) using Response.Flush. This is to
let the user know that processing has started.
After the procedure has completed, I update the span message using its
ID with 'processed' or 'failed' accordingly.
So far so good!
The problem I have is that it only worked during development. This
seems to be because during development I used an example I picked up
from the ASPFAQ site to simulate database activity (ie a 15 second
delay) without actually doing anything using SQLServer:
sleep = 15
cn.open "Provider=sqloledb;Data Source=SVR;User Id=id;Password=pw"
cn.Execute "WAITFOR DELAY '00:00:" & sleep & "'"
With the above script everything worked great, and I could open three
or four different procedures and have them all running simultaneously.
Just what I wanted!
However when I switched to running the actual procedures Oracle (which
take a couple of minutes) I've found that it will only run one
procedure at a time. And while this one procedure is running I lose
communication with the parent window (the list of jobs) until the
procedure has finished.
Does anyone have any idea what might be causing this? The only
difference (apart from the SQL) between running in live (Oracle) and
simulating activity using SQL Server is the Provider. Could the Oracle
provider be missing something the SQL Server Provider has? And if so,
what might this be and can I get round it?
I've copied an example maintenance job page below.
TIA,
Colin
<%@Language=VBScript%>
<%Option Explicit%>
<%Session.LCID = 2057%>
<!-- #INCLUDE FILE="functions.asp" -->
<!-- #INCLUDE FILE="formatting.asp" -->
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
</head>
<body id="oBody"
style="filter
<div id=messageToUserTxT
style="background-color:3996FF;color:ffffff;position: absolute; left:
0; top: 0;">
Processing Receipts...
</div>
<table height="100%" width="100%">
<tr>
<td align=center>Process Receipts</td>
</tr>
</table>
<%
Response.flush()
Dim cn
Dim sql
Dim arSQL()
Dim sleep
Dim testing
'Setup SQL
Redim arSQL(2)
arSQL(0) = "begin"
arSQL(1) = " Pacs_Inbound_Api.Process_Receipts;"
arSQL(2) = "end;"
'Setup connection
Set cn = Server.CreateObject("ADODB.Connection")
'RUN AS TEST OR LIVE?
testing = True
'testing = False
If testing Then
'TESTING
Server.ScriptTimeout = 20
sleep = 15
cn.open "Provider=sqloledb;Data Source=SVR;User Id=id;Password=pw"
cn.commandTimeout = 15
cn.Execute "WAITFOR DELAY '00:00:" & sleep & "'"
Else
'LIVE
Server.ScriptTimeout = 600
cn.open "Provider=OraOLEDB.Oracle;Data Source=SVR;User
Id=id;Password=pw"
cn.execute Join(arSQL,"")
End If
'Destroy SQL array
Erase arSQL
If Err.number <> 0 Or cn.Errors.Count <> 0 Then
response.write "<br>" & err.Description
%>
<script language=javascript>
// After setting Apply, changes to the oBody object
// are not displayed until Play is called.
oBody.filters[0].Apply();
oBody.style.backgroundColor="FFD3D3";
oBody.filters[0].Play();
messageToUserTxT.innerText = ' Processing failed! ';
</script>
<%
Else
%>
<script language=javascript>
// After setting Apply, changes to the oBody object
// are not displayed until Play is called.
oBody.filters[0].Apply();
oBody.style.backgroundColor="CEFFC2";
oBody.filters[0].Play();
messageToUserTxT.innerText = ' Processing complete! ';
</script>
<%
End If
cn.Close: Set cn = Nothing
%>
</body>
</html>