Re: ADO in multithreaded: Application Verifier (with WinDbg) gives "Invalid Handle" at the end of my application



Dvorak wrote on 28 Nov 2006 01:52:06 -0800:


Daniel Crichton wrote:

Sorry if this sounds like a stupid suggestion, but did you switch ADO to
free-threaded? By default ADO is apartment-threaded (both-threaded), so
calls will be serialized - this is so that it can support Access/Jet
which uses a single-threaded driver. You can change ADO to free-threaded
by editing the registry, you do this using the ADOFre15.reg file located
in the C:\Program Files\Common Files\System\ADO folder.

I'm using MSSql Server as database, so I don't think that changing in a
free-threaded will do something good. But, I'm somehow desperate and I
tried this too, with no luck of course.

This setting will only break Access/Jet, so for MS SQL Server it would not
do anything bad, except for the connection pooling handling.

If the database you are connecting to has a driver that support
connection pooling then trying to share a connection via threads may well
result in slower performance. It's also possible that the connection
could be dropped or the link to the server broken in some way, so you'll
need to make sure you handle this possibility too.

Dan
The connection to the database isn't shared, so I don't have to be
afraid from this part. Only a single thread uses it.

Oh well, that's me out of ideas. I don't touch threading, being a VB
programmer it's not that easy to deal with :P

Dan


.



Relevant Pages

  • Re: Cross Transactions between ADO & ADO.Net
    ... connection--it thrashes the server unnecessarily and discards useful server ... goes away and quietly reopen the connection when they return. ... > DTC transactions are not only heavy, they might also cause deadlocks due ... We even call ADO ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Permissions???
    ... > Server: SQL Server 2000. ... > the user could Write/Read data from server and execute stored procedures. ... > The connection was made with DSNs. ... ADO gives the following message when using stored ...
    (microsoft.public.data.ado)
  • Re: Problem with anonymous connections
    ... but you can use another user account instead-of IUSR_machine ... I'm using the ADO recordset object to get data and this is in an ASP ... the user can open a shared folder on the SSAS server first (so the user is ... > A connection cannot be made. ...
    (microsoft.public.sqlserver.olap)
  • Re: Stored Procedure from Access
    ... stored procedure via an ADO connection to the server, ... You have to specify a suitable connect string for ... Connection object, which will have to be opened with a suitable connect ...
    (microsoft.public.access.formscoding)
  • Re: Error -2147168227 Cannot create new transaction because capacity was exceeded.
    ... Try to run SQL profiler, which ships with SQL Server to see how many ... > object and there is only 1 instance per application of the connection ... Prior to that I've just closed the ADO recordset object. ...
    (microsoft.public.data.ado)