BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Best way to have more than one unit for webbroker CGI / Isap

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Isapi-WebBroker
View previous topic :: View next topic  
Author Message
Peter
Guest





PostPosted: Sat Jan 08, 2005 10:24 am    Post subject: Best way to have more than one unit for webbroker CGI / Isap Reply with quote



Hello all,

What's the best way to go to build a CGI / Isapi webbroker which returns a
respond with data from a SQL2000 Database.
The webbroker should be able to deal with 50+ requests every 30 seconds.
(due to update GPS coordinates and will give almost a real time track and
trace)
To make my code more managable I want to have functions in seperate
code-units like to set the connection and query commands.
I've noticed that when I add code-units to the project the for example
ADOConnection is not reachable (it will compile in code, but will fail in
runtime - the same with queries)

Any tips and advice is most welcome.

Thanks

Peter.


Back to top
Del M
Guest





PostPosted: Mon Jan 10, 2005 9:34 am    Post subject: Re: Best way to have more than one unit for webbroker CGI / Reply with quote



With that many requests, CGI is probably not a good idea since you will be
constantly loading the program over and over which will thrash the IO
channel on your server. ISAPI would be better. The "separate code units"
that you reference .. if you mean .pas files, I never do that. I just make
them functions within the ISAPI. Because ISAPI is a little funky, you would
have to be creating objects (the connections and query objects) in code. I
find it easier to just drop them on the webmodule as I believe it was
intended. I'm sure other wont agree but it works for me and I never have
memory leaks or other problems. ISAPI's can be rather large with no problems
since the OS does a better job of managing the memory that I do by trying to
segment my programs and I find that despite the ablity to create "reusable
code", I have actually found that every "resuable" bit, somehow always seems
to require just a little bit of a different nuance than when it was last
used. Thats why I dont create extra datamodules as I think you are inquiring
about.

You will need to maintain state for each client in the ISAPI.


Back to top
Marco Sella
Guest





PostPosted: Mon Jan 10, 2005 9:34 pm    Post subject: Re: Best way to have more than one unit for webbroker CGI / Reply with quote



Peter,

Keep in mind that in an ISAPI application there is no global instance of
WebModule (despite the WebModule1 variable). Therefore the following code
will always fail:
WebModule1.adoInvoices.Open.

Within the WebModule use "Self". For code in other units, you have to pass
the WebModule (or the dataset) as a parameter, like:

unit Invoices;

uses WebModuleUnit;

function GetInvoices(AWebModule: TWebModule1): string;
begin
Result := '';
with AWebModule.adoInvoices do
begin
Open;
while not Eof do
begin
Result := Result + //....do whatever here...
end
Close;
end;
end;


Back to top
Peter
Guest





PostPosted: Wed Jan 12, 2005 8:57 am    Post subject: Re: Best way to have more than one unit for webbroker CGI / Reply with quote

Thank you for the answers.

It makes a lot easier now to decide which way to go....

Kind regards,

Peter.




"Marco Sella" <nono (AT) yahoo (DOT) com> schreef in bericht
news:41e2f4d6$1 (AT) newsgroups (DOT) borland.com...
Quote:
Peter,

Keep in mind that in an ISAPI application there is no global instance of
WebModule (despite the WebModule1 variable). Therefore the following code
will always fail:
WebModule1.adoInvoices.Open.

Within the WebModule use "Self". For code in other units, you have to pass
the WebModule (or the dataset) as a parameter, like:

unit Invoices;

uses WebModuleUnit;

function GetInvoices(AWebModule: TWebModule1): string;
begin
Result := '';
with AWebModule.adoInvoices do
begin
Open;
while not Eof do
begin
Result := Result + //....do whatever here...
end
Close;
end;
end;





Back to top
Del M
Guest





PostPosted: Wed Jan 12, 2005 1:03 pm    Post subject: Re: Best way to have more than one unit for webbroker CGI / Reply with quote

also, check out www.matlus.com for some other helpful guidance.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Isapi-WebBroker All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.