🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1172

TWebModule creation and destruction

#1172
From: Mark Jacobs
Date: Thu, 09 Jun 2005 14:02
30 lines
2013 bytes
I have read that TWebModule does not unload its DLL between requests unless

Application->CacheConnections=false;

is set. Does that mean that my WebModuleDestroy event won't be called after 
each request unless I set Application->CacheConnections=false; ?

//---------------------------------------------------------------------------
void __fastcall TWebModule1::WebModuleDestroy(TObject *Sender)
{
   mjclosedb(AdsTable1,AdsConnection1); mjclosedb(AdsTable3,AdsConnection3);
   delete fldlist; delete idxlist; if (cpd1) { delete cpd1; cpd1=NULL;}
}

In my constructor, I have :-

//---------------------------------------------------------------------------
__fastcall TWebModule1::TWebModule1(TComponent* Owner)
	: TWebModule(Owner)
{
   fldlist=new TStringList(); idxlist=new TStringList();
   rtpth=ExtractFilePath(ParamStr(0)); 
rtpth=ExtractFilePath(ParseFileDesc(rtpth+"..\\Surveys\\"));
   ForceDirectories(rtpth);
}

Where should I be closing my databases? Wehre should I be opening them? TIA,
-- 
Mark Jacobs
http://www.dkcomputing.co.uk
Technical Details
Message-ID: <42a84bcb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!ecngs!feeder.ecngs.de!38.119.100.83.MISMATCH!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,bd4ef0b410ee30c3,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 09 Jun 2005 15:02:11 +0100
From: Mark Jacobs <http://www.jacobsm.com/mjmsg.htm?mj@critical>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.web
Subject: TWebModule creation and destruction
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.144.157.8
Message-ID: <42a84bcb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1118325707 81.144.157.8 (9 Jun 2005 07:01:47 -0700)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!ecngs!feeder.ecngs.de!38.119.100.83.MISMATCH!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail