Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fast demands gives err 500
#6
(06-03-2019, 09:30 AM)Alexandre Machado Wrote:
(06-03-2019, 03:53 AM)ib elfving Wrote:
(06-03-2019, 02:19 AM)Alexandre Machado Wrote: Hi,

As Dan pointed out above, which version of IW and Delphi are you running?

Also, it is not clear that the calls to your content handler are targeted to the same session or different sessions. Is your session control based on cookies? If so, are you sending the cookies correctly to the server?

Sorry for the missing info.

Delphi XE 5 (the application runs on an old windows XP)
intraweb version is 14.0.52
Mode: SA
Not using cookies
Database: Firedac/mysql

The handler is an API for an external web application. The handler produces a label (for shipping goods). The problem arises when the client program does a bulk print (e.g. sends for instance 10 individual calls for 10 labels to the handler within a second). The handler produces a PDF label, writes this to disk and returns a string to the calling program, that contains the web-address of the PDF file for each of the 10 calls.

I have tried to lock the session (asession.lock   .handler-code...   asession.unlock), 
tried to delay each the session (makes no sense if the session is not locked, as it is timer based)

What I need is some way to delay the jobs until the current client job is terminated. The documentation for intraweb states that the 10 jobs is queued and executed one at the time, but somehow the process does not wait until all processes is terminated. It seems as it is the database process that is not done.

The problem is probably a firedac/mysql issues (blocking versus non-blocking), but the quick and dirty way to solve the problem is to delay each call in Intraweb.

Regards ib

If you based your code on IW.Content.XML.pas (from one of our demos) each call should start a new session. Each one should run independently without any issues, as long as your code is also thread safe. Is it?

In that regard, you should not share any global objects (e.g. a Database connection). If you share some code it would be easier to spot any potential problems....

I am not using any global IW-variables. My database (except for the firedac database connection) is accessed through variables in the usersession, so this should isolate the individual session data from each other, but I am using an ordinary delphi-unit for business routines. I will check this for variables that might cause the conflict, maybe try to move the database connection to the usersession instead to see if this makes a change.

Still - is it possible in an easy way to delay each call to the handler - e.g. 10 request arrives to the SA within 1 sec, but is "delay" so that each request starts with a delay of for instance 1 sec. (request 1 start at 1 sec, request 2 starts at 2 sec .. request 10 start at 10 sec)

regards ib
Reply


Messages In This Thread
Fast demands gives err 500 - by ib elfving - 05-28-2019, 03:21 PM
RE: Fast demands gives err 500 - by DanBarclay - 05-29-2019, 01:06 AM
RE: Fast demands gives err 500 - by ib elfving - 06-03-2019, 03:53 AM
RE: Fast demands gives err 500 - by ib elfving - 06-03-2019, 12:29 PM
RE: Fast demands gives err 500 - by zsleo - 06-03-2019, 09:24 PM
RE: Fast demands gives err 500 - by joel - 06-04-2019, 01:29 AM
RE: Fast demands gives err 500 - by ib elfving - 06-04-2019, 03:00 AM
RE: Fast demands gives err 500 - by DanBarclay - 06-04-2019, 01:08 AM
RE: Fast demands gives err 500 - by ib elfving - 06-04-2019, 05:22 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)