Article View: borland.public.cppbuilder.nativeapi
Article #9264Re: Thread and memory
From: Sara T.
Date: Wed, 21 Jul 2004 02:20
Date: Wed, 21 Jul 2004 02:20
30 lines
2325 bytes
2325 bytes
> > Synchronize(UpdateDatabase);
> You might want to look at using Sessions instead. They are designed for
> allowing multi-threaded access to databases.
>>>> Could you please give me a little sample? I don't understand about the
word "Sessions".
> > FreeOnTerminate = true;
> You should set that in the constructor instead.
>>>> Firstly I have this statement on ONLY constructor but I need to make
sure, so I put it before thread terminates again. Anyway, I will put it out.
Thanks.
> > Terminate();
> There is no need to call that since you are not using the Terminated
> property afterwards. The thread will be terminated when Execute() exits.
>>>> Thanks again, I thought about it too but I have seen a little sample of
another that just use it to make sure.
> > catch (...) {
> That generally is not good to use for catching VCL exceptions. You should
> use this instead:
> catch(const Exception &)
>>>> Thanks about it. It is a new idea for me.
> > delete ADOQuery;
> Are you sure that your code reaches that line correctly?
>>>> Yes, because I have ever put the log (write file) to see the process
and that always pass the bottom of the Execute line in thread.
Sara T.
Technical Details
Message-ID:
<40fdd26b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40fb3d08@newsgroups.borland.com> <40fbf87b$1@newsgroups.borland.com> <40fbfd74$1@newsgroups.borland.com> <40fc1022$1@newsgroups.borland.com> <40fcab00@newsgroups.borland.com> <40fcc3d3$1@newsgroups.borland.com> <40fce10f@newsgroups.borland.com> <40fd598d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d35c53850c011fac X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Sara T." <sarana@infoquest.co.th> Newsgroups: borland.public.cppbuilder.nativeapi References: <40fb3d08@newsgroups.borland.com> <40fbf87b$1@newsgroups.borland.com> <40fbfd74$1@newsgroups.borland.com> <40fc1022$1@newsgroups.borland.com> <40fcab00@newsgroups.borland.com> <40fcc3d3$1@newsgroups.borland.com> <40fce10f@newsgroups.borland.com> <40fd598d$1@newsgroups.borland.com> Subject: Re: Thread and memory Date: Wed, 21 Jul 2004 09:20:23 +0700 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 169.210.34.33 Message-ID: <40fdd26b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1090376299 169.210.34.33 (20 Jul 2004 19:18:19 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail