pause code in a web application?

P

Paul

Hi just wondering if running a web application in a single thread is it
possible to add a pause in the code?
Thanks
 
H

Hans Kesting

After serious thinking Paul wrote :
Hi just wondering if running a web application in a single thread is it
possible to add a pause in the code?
Thanks

System.Threading.Thread.Sleep(...) with a TimeSpan or a number of
milliseconds.

but why would you want to do that?

Hans Kesting
 
M

Mark Rae [MVP]

Hi just wondering if running a web application in a single thread is it
possible to add a pause in the code?

As others have said, it is possible, but why on earth would you want to
deliberately delay a web response...?
 
P

Paul

thanks for the responses, I have some sort of timeout issue I think but it
does seem like slowing the web response may not be a solution. I have a
document that is used in Crystal reports and on the method document.close I
get the error,
object not set to an instance of an object, like it has not been
instantiated. Works fine for short queries under a minute or so and only
occurs on long queries, were data is processed for several years. Also not
sure if crystal report has some sort of default timeout if it is waiting for
something.
 
P

Patrice

IMO it's always best to try first (if not already done) to solve the initial
problem.

Not sure what kind of document you are talking about. If using automation
note that some products are not intended for server side use. You also have
a script timeout that prevent long running pages etc etc...

For now it lloks like the object that represent this document doesn't exists
(for example if the document is already opened, opending another instance of
it could perhaps fails).
 
P

Paul

Hi, thanks for the additional information. Yep still trying to figure out
what is going on (the problem) but it does seem to be some type of time out
as using the same code works fine with the same query run for a short date
range vs a failure with the same query and code run for long date ranges.
The document is from the crystal report engine (ReportDocument) so it is one
of the crystal objects that you can use to display a report.
 
P

Patrice

Have you tried to test if the object is null or nothing (depending on the
language you are using ?) right after the creation function ?
I'm not using Crystal Report myself. Hopefully someone that is using it will
enter. You may want to start a new thread as the subject totally changed
;-).

Posting the smallest possible sample code that shows your problem may also
help all along with the exact error message (including perhaps the call
stack so that we can see if this is in your own code or if something could
be wrong in the thrid party code). Surely some CrystalReports users have
long queries....

Good luck.
 
P

Paul

thanks for the additional information. It looks like I have a
response.redirect and the object gets set just before this, so for a short
query the object is fine but for the longer query the object goes null after
the response.redirect!
 
P

Paul

Discovered the problem, the object was being saved in a session variable and
someone had added a session timeout of 1 minute to the web.config file
therefore the session variable was timing out.
thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top