Hi, 

> No, each thread MUST open a database connection with db.Connect.

Hmm, are you sure? Wouldn't it be okay to just wrap your queries and
SQLExecutes in crtical sections? Just give your connection a critical
section property and enter and leave it as you please. This might be a
little bit faster then having to connect each time you spawn a new thread.

Well, everything depends on what exactly the app does, of course.

-> Maximilian Tyrtania | [EMAIL PROTECTED]
  fischerAppelt Kommunikation GmbH
  Tucholskystr. 18 | D-10117 Berlin | Germany
  Tel. ++49-30-726146-728 | Fax ++49-30-726146-710
  www.fischerAppelt.de


> So in each thread there should be a code like this:
> 
> db = New REALSQLDatabase
> db.DatabaseFile=dbFile
> If db.Connect() then ...
> 
> and then you can use your code to execute your queries...
> ---
> Marco Bambini
> http://www.sqlabs.net
> http://www.sqlabs.net/blog/
> http://www.sqlabs.net/realsqlserver/
> 
> 
> 
> On Oct 16, 2006, at 12:32 PM, Scott Goelzer wrote:
> 
>> Thanks Norman,
>> Just to be sure I understand, an individual connection would mean
>> something like
>> 
>>  start the thread running.
>> rs = new recordset
>> 
>> rs = mydatabase.SQLSelect(someQuery)
>> 
>> if App.myDatabase.ErrorCode >0 then
>> 
>> ...
>> do stuff with rs 'code inside the thread
>> .......
>> 
>> I will now display my complete ignorance of threads and wish for
>> more concrete examples:
>> In a thread, if I call a function or method stored in a module does
>> that run as entirely separate code?
>> I'm curious about what happens if a function or module is called to
>> run concurrently with a thread. Does it work and behave?
>> How about multiple identical threads running?
>> 
>> Thanks
>> Scott
>> 
>> 
>> 
>> 
>> 
>> 
>> *******************************************
>> Scott Goelzer
>> Physics Teacher
>> Coe-Brown Northwood Academy
>> Northwood NH 03261
>> [EMAIL PROTECTED]
>> *******************************************
>> 
>> 
>> On Oct 15, 2006, at 11:18 PM, Norman Palardy wrote:
>> 
>>> 
>>> On Oct 15, 2006, at 1:23 PM, Scott Goelzer wrote:
>>> 
>>>> I could use some database guru advice. I currently have a
>>>> database front end that require significant data processing after
>>>> data is entered or changed. Currently, I have a hidden window
>>>> that runs a timer and keeps and checks which records need
>>>> reprocessing and does them one at a time, allowing the interface
>>>> to mostly continue. This is ugly (but works). I am trying to
>>>> learn threads in order to improve this (not easy since the
>>>> examples seem to focus on showing the extremes of threads, not
>>>> how to set a simple use and there is almost nothing in the
>>>> documentation).
>>>> 
>>>> How does a RealSqldatabase handle both a thread and the main
>>>> program making calls to the same database? How am I supposed to
>>>> handle it? Should I even pursue this?
>>> 
>>> make every thread have it's own connection to the database and you
>>> should be fine
>>> 
>>> _______________________________________________
>>> Unsubscribe or switch delivery mode:
>>> <http://www.realsoftware.com/support/listmanager/>
>>> 
>>> Search the archives of this list here:
>>> <http://support.realsoftware.com/listarchives/lists.html>
>> 
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>> 
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
> 
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> 
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to