By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,025 Members | 2,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,025 IT Pros & Developers. It's quick & easy.

New Window Kills Browser When Connected to Oracle

P: n/a
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:progid:DXImageTransform.Microsoft.Fa de(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>

Jul 22 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
IIRC an ASP session can only have a single script processing at a given
time.

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

<co************@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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:progid:DXImageTransform.Microsoft.Fa de(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>

Jul 22 '05 #2

P: n/a
Humm, that makes sense. Are there any ways of getting the script to
run in another session to avoid this?

Thanks Mark,

Colin

Jul 22 '05 #3

P: n/a
co************@gmail.com wrote on 16 dec 2004 in
microsoft.public.inetserver.asp.general:
Humm, that makes sense. Are there any ways of getting the script to
run in another session to avoid this?


What makes sense?

This is not email but usenet, so please quote the Q you are answering on.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 22 '05 #4

P: n/a
Not easily. The session cookie is usually associated with the browser
process. In order to get a separate session you need to open the new browser
window in a separate process. There used to be a setting for this in IE 4
(it usually caused problems by NOT sharing sessions between browser
windows).

Would it be possible to have the user select a set of operations to perform
and then run them sequentially?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
<co************@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Humm, that makes sense. Are there any ways of getting the script to
run in another session to avoid this?

Thanks Mark,

Colin

Jul 22 '05 #5

P: n/a
>What makes sense?

This is not email but usenet, so please quote the Q you are answering

on.

Your right. I'm posting from the Google Groups beta, and it doesn't
seem to include the original post like the old one used to. There is
probably an option for it somewhere but I cant find it. To quote you
post, I've had to cut and paste into the reply form...

Jul 22 '05 #6

P: n/a
>Would it be possible to have the user select a set of operations to
perform
and then run them sequentially?


Possibly. I'd better talk to the users and see how import this is.

The only other option might be to use ASP to kick off a VBScript and
not wait for it to return... But I've tried this before and had
terrible problems with permissions and never did get it working.
Thanks for posting.

Colin

Jul 22 '05 #7

P: n/a
Other options:

MSMQ (Microsoft Message Queuing) to trigger processing by external program,
then send email back to user or set a flag in a file some where that an ASP
page can check peridically (use refresh metatag, not time delay on server).

Create a batch file in a specific directory to run the job. Have a scheduled
task look for new files and run them. Notify user as above. Should be able
to create a windows service that detects new files in the directory.

Use stored procedures which run asynchronously. I have heard of this for
SQLServer, not sure if it can be done with Oracle.

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

<co************@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Would it be possible to have the user select a set of operations to

perform
and then run them sequentially?


Possibly. I'd better talk to the users and see how import this is.

The only other option might be to use ASP to kick off a VBScript and
not wait for it to return... But I've tried this before and had
terrible problems with permissions and never did get it working.
Thanks for posting.

Colin

Jul 22 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.