Re: asychronous OLEDB



Hi, Alberto:

There are two samples available within our OleDBPro at www.udaparts.com to
show you how to do OLEDB asynchronously. The samples have much opened source
code, which may help you figure out asynchronous execution with OLEDB.

MS OLEDB providers and others well support both single- and free-threaded
apartments. You don't need to do marchalling at all if you set worker
threads to MTA. It is actually very simple.


Regards,




"Alberto Demichelis" <AlbertoDemichelis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:7414B544-87D3-4509-AD64-09F5074CE7CA@xxxxxxxxxxxxxxxx
Hi all,

I'm trying to figure out how to make asychronous queries with OLEDB(C++)
for
the
following problem.

My scenarios is this. I have a large real-time simulation server, the
server
handles about 1000 concurrent clients. Because of the nature od the
simulation
all the computation(except network & IO) is done in the same thread. Every
100ms
all slots (clients) get an update get simulated. Occasionally, based on
the
action performed by the client I need to perform a SQL query(SQL server
2005).

Now my problem is this: CPU wise we are more than fine with 100ms/1000
clients only SQL queries generate sporadic spikes(up to 30ms, usualy
around
10ms).
If a client slot stalls for 10ms waiting for OLEDB this is very dangerous;
all slots
are processed one after the other synchronously so if 10 slots stall on
some
DB query, my server timeslice is gone and the simulation will degrade.

My server is mostly written in C++(unmanaged), the simulation logic is
written with a scripting language that supports cooperative
threads(www.squirrel-lang.org) so I was planning to expose my OLEDB
interface
in a way that will perform my query asychronously.
I can then yield my script(each client has a different cooperative thread)
put the pending command in a list and then every 100ms poll for completion
and eventually resume my cooperative thread and process the result/error.
In
this way only the interested slot stalls and the rest of the clients are
unaffected.

My questions are:
Is it possible to perform sn asychronous query? (I guess so I read about
it
but found no sample)
If yes where can I find a sample? (OLEDB C++ also no ATL is fine)
Is it possible to be sure that resulting the recordset of a select is
alredy filled? (in the context of an asychronous query)
Alternatives to OLEDB?

A possible solution would be to create a separated thread and to the asycn
by myself, but because I suspect OLEDB is capable of this already I'd like
to
avoid having to write my own cross thread marshalling etc...

If I'm asking too much and there is already an online source where I can
find my answer pointing me to that would be more than enough.

Thanks for you time

ciao
Alberto Demichelis







.



Relevant Pages

  • Re: Can someone please tell me...(maybe Frans Bouma)
    ... Why no vendor independent way to get all tables, views, & stored ... The OleDb info is in the registry and the Oracle info is ... everything it could to have tons of clients shipped with Windows. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Can someone please tell me...(maybe Frans Bouma)
    ... Why no vendor independent way to get all tables, views, & stored ... The OleDb info is in the registry and the Oracle info is ... everything it could to have tons of clients shipped with Windows. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Windows service and oledb
    ... Make sure that you're trapping all exceptions and the target server is setup ... of OleDb when connecting to SQL Server. ... > user account, to see if it has something to do with access to the database ... > server machine (before connecting to the machine), ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: IDENTITY_INSERT - Daten mit Identitätsspalten Importieren
    ... was der Jet OleDb Treiber ... Import Data into SQL Server from Excel ... Und ersetze dort Excel durch MDB - ist sowieso alles der Jet ... Use the DisallowAdHocAccess Setting to Control Access ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)
  • Re: OLEDBCommand vs. SQLCommand
    ... I almost always use the OleDb classes. ... realies on COM interop while the SQLClient is a truely native to SQL ... Server versions 7 and up. ... especially for Microsoft's SQL Server databases, ...
    (microsoft.public.dotnet.languages.vb)