|
Home > Archive > dBASE Web Applications > March 2006 > plusrun.exe hangs when Stop Button is pressed
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
plusrun.exe hangs when Stop Button is pressed
|
|
| Dean Watson 2006-03-10, 3:23 am |
| I am sure someone can help with this one. If a user presses the Stop button
in the Tool Bar of their browser whilst plusrun is still working, the
plusrun session hangs. Is there a timer element I can introduce into the
code or some other simple fix to overcome this problem? I am running Plus
2.6 on an apache 2 Webserver.
Regards, Dean.
| |
| Ken Mayer [dBVIPS] 2006-03-10, 9:23 am |
| Dean Watson wrote:
> I am sure someone can help with this one. If a user presses the Stop button
> in the Tool Bar of their browser whilst plusrun is still working, the
> plusrun session hangs. Is there a timer element I can introduce into the
> code or some other simple fix to overcome this problem? I am running Plus
> 2.6 on an apache 2 Webserver.
Have you added:
_app.allowYieldOnMsg := true
To your code? Just a thought.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Christian K 2006-03-10, 11:23 am |
| I once heard there was a property you could set to specify how long a
script will run, but I don't recall if it was a windows reg hack or an
apache configuration. I never really followed up on it.
However, I did run across a VB Script which will kill a process running
longer than a specified amount of time. Ran across it in the Gene6 FTP
Server forums. I haven't used it, but the idea is you throw it in
windows scheduler & have it run every 5 minutes or so. Here is the
script:
'~~[author]~~
'Phill Robinson
'~~[/author]~~
'~~[emailAddress]~~
'Phill. Robinson@CoventryBui
ldingSociety.co.uk
'~~[/emailAddress]~~
'~~[scriptType]~~
'vbscript
'~~[/scriptType]~~
'~~[subType]~~
'SystemAdministratio
n
'~~[/subType]~~
'~~[keywords]~~
'Kill Process
'~~[/keywords]~~
'~~[comment]~~
'Kills a process if it has been running more than a set time. Schedule
it to run every 5 minutes from within the Windows Scheduler.
'~~[/comment]~~
'~~[script]~~
Const App2Kill = "cpustres"
Const MaxTime = 120
Call GetProcTime(App2Kill
)
' ~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~-----
' Function to get process Elapsed Time
' ~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~-----
Function GetProcTime(ProcName
)
'
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colProcesses = objWMIService.ExecQuery("SELECT * FROM
Win32_PerfRawData_Pe
rfProc_Process WHERE Name = '" & ProcName & "'")
For Each objProcess in colProcesses
ProcTime =
((objProcess.Timestamp_Object)-(objProcess.ElapsedTime))/(objProcess.Fre
quency_Object)
If Int(ProcTime) > MaxTime Then
Call TerminateProcess(obj
Process.IDProcess)
End If
Next
'
End Function
' ~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~
' Function to terminate a process
' ~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~
Function TerminateProcess(PID
)
'
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colProcesses = objWMIService.ExecQuery("SELECT * FROM
Win32_Process WHERE Handle = '" & PID & "'")
For Each objProcess in colProcesses
On Error Resume Next
return = objProcess.Terminate()
If Error Then
TerminateProcess = FALSE
Else
TerminateProcess = TRUE
End If
Next
'
End Function
'~~[/script]~~
Cheers,
Christian K.
Dean Watson wrote:
> I am sure someone can help with this one. If a user presses the Stop
> button in the Tool Bar of their browser whilst plusrun is still
> working, the plusrun session hangs. Is there a timer element I can
> introduce into the code or some other simple fix to overcome this
> problem? I am running Plus 2.6 on an apache 2 Webserver.
>
> Regards, Dean.
| |
| Dean Watson 2006-03-11, 11:23 am |
| Hi Ken,
I have not used this parameter before as I had not heard of it. Where would
it be placed in the progam? Reading the description in the Help file, it
seems to be more aimed at normal desktop applications, rather than web
applications, based on the triggers for WM_QUIT.
Perhaps I should be rebuilding my web apps with the WEB parameter?
Regards, Dean.
"Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote in message
news:uJj17uERGHA.2320@news-server...
> Dean Watson wrote:
button[color=darkred
]
Plus[color=darkred]
>
> Have you added:
>
> _app.allowYieldOnMsg := true
>
> To your code? Just a thought.
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase
| |
| Dean Watson 2006-03-12, 8:23 pm |
| First of all, thanks to Ken Mayer for getting me to start digging in the
Language Reference of the help file. The successful fix for this problem was
to rebuild all my web apps in 2.6 with the WEB keyword (which I was not
aware of until Ken's response lead me to do some more digging). Not bonly
does this help the apps run faster, deliberate attempts to hang Plusrun.exe
now fail, with first the .dbw and then Plusrun.exe both terminating
gracefully after a few seconds.
Regards, Dean.
"Dean Watson" <dean.watson@telesavers.com.au> wrote in message
news:dov$iXBRGHA.1740@news-server...
> I am sure someone can help with this one. If a user presses the Stop
button
> in the Tool Bar of their browser whilst plusrun is still working, the
> plusrun session hangs. Is there a timer element I can introduce into the
> code or some other simple fix to overcome this problem? I am running Plus
> 2.6 on an apache 2 Webserver.
>
> Regards, Dean.
>
>
| |
| Ken Mayer [dBVIPS] 2006-03-13, 9:23 am |
| Dean Watson wrote:
> Hi Ken,
>
> I have not used this parameter before as I had not heard of it. Where would
> it be placed in the progam? Reading the description in the Help file, it
> seems to be more aimed at normal desktop applications, rather than web
> applications, based on the triggers for WM_QUIT.
I was sort of grabbing at straws. <g> However, it would go early in the
program (or programs).
> Perhaps I should be rebuilding my web apps with the WEB parameter?
That is a useful thing to do, as it will speed up the load time.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Bowen Moursund [DataTech] 2006-03-13, 9:23 am |
| > Perhaps I should be rebuilding my web apps with the WEB parameter?
If you're NOT, then that most likely is the problem. Also ensure that you
have the relevant environment variable set properly:
DBASE_SUPPRESS_START
UP_DIALOGS=1
--
Bowen Moursund
DataTech
Consulting & Development
http://www.bmmnet.us
|
|
|
|
|