Go Back   NexusDB Newsgroups > Support Newsgroups > nexusdb.public.support
Log in
FAQ Members List Calendar Today's Posts

 
Thread Tools Display Modes
  #1  
Old 19th March 2007, 08:45 AM
Chris
 
Posts: n/a
Default Thread Question

Hi

Is this allowed:

Pop up a new form that asks for user input (start and end date), when user
presses 'Go' start a new thread that's only work is to do
'nxQuery1->Open();' which allows me to display an animated progress bar
while the query executes (I expect it to take a while depending on the date
range selected by the user).

The nxQuery will be placed on the form and nothing in my code ever touches
it (other than the thread) and it is not connected to any controls (other
than the Database->Session->Server->Transport chain).

In the past I have created a new session and then database and then query
but it occurs that this is overkill in this scenario. I have created a test
app and tested a good few times and it definately appears to work but I
really don't want to start receiving errors in my real application.

Best regards

Chris F


  #2  
Old 19th March 2007, 09:02 AM
Hannes Danzl[NDD]
 
Posts: n/a
Default Re: Thread Question

If you make 100% sure that nothing else is touching that session at the same
time this will work. I personally would always use a dedicated chain for every
thread. I've a small helper unit that implements a very simple TSimpleDBThread
which has the following:

public
constructor Create(aTransport: TnxBaseTransport; anAlias: String;
aSuspended: Boolean); virtual;
destructor Destroy; override;
function GetTable: TnxTable;
function GetQuery: TnxQuery;
property Session: TnxSession read fSession;
property Database: TnxDatabase read fDatabase;
end;

Alternatively if you use a session pool just check out the
TnxThreadWithSession, TnxThreadWithDatabase classes in nxdb.

--

Hannes Danzl [NexusDB Developer]
Newsgroup archive at http://www.tamaracka.com/search.htm



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread question... Jon P. Grewer nexusdb.public.discussions 2 24th July 2007 07:09 AM
Executing Query in an Thread Andreas Osswald nexusdb.public.support 1 24th August 2006 01:07 AM
Thorsten, Thread example ... Scott Martin nexusdb.public.discussions 4 30th June 2006 10:22 PM
NexusDB Thread Example William E. Mahaffey nexusdb.public.discussions 8 18th September 2003 01:54 PM
drive too small - new thread Theo nexusdb.public.support 7 17th July 2003 06:57 AM


All times are GMT +11. The time now is 03:40 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.