Re: Best way to use a sigle TADOconnection with several threads



It happens that Paul formulated :
Hi all,

I have a server that uses 11 threads for database connectivity. (SQL2005)
Currently, they all use their own TADOConnection which is created and freed at runtime.
Sometimes (after a few weeks), I get a connection time-out error in one of the threads.
I haven't found what the problem could be.
I'm thinking of using a single connection, but it may mot run in the context of the main thread.

What is the best approach ?

I do not think you can use a single connection from multiple threads.
Try to use a connection pool to use a fixed number of active connections.


Regards
Yannis.


.



Relevant Pages

  • Re: SQL wont work
    ... It seems like the basic component SQL statement is working but the code isn't. ... All you need is a TADOConnection, a TADODataSet and a TDataSource if you're using bound controls. ... Drop a TADOConnection on your form or in your data module and make sure the connection string to your MySQL database is correct. ... Add a TADODataSet. ...
    (comp.lang.pascal.delphi.databases)
  • Re: BDS 2006 ADO EOleException
    ... The connection string is this one: ... this is not the problem because if I make a new project and simply put an TADOConnection on the form I get the same error. ... And the programs ARE WORKING correctly outside the IDE!!!! ... I meant debug mode ...
    (borland.public.delphi.database.ado)
  • Re: SQL wont work
    ... All you need is a TADOConnection, a TADODataSet (or the ... Do I understand correctly that you have entered an SQL statement at design ... connection string to your MySQL database is correct. ...
    (comp.lang.pascal.delphi.databases)
  • Re: Weird TADOConnection Behavior
    ... the TADOConnection connectionstring was taken by it which in ... hardcoded to connect to a certain database. ... The connection string is very much the same except for the Database part, ...
    (borland.public.delphi.database.ado)
  • Re: Damn you, FEDEX! or Nikon D40 lost in Springfield, MO blackhole.
    ... the 2 mp Mavica he had been using with a Nikon D40. ... After shopping around, he got me to order one for him. ... The shipper had it insured, but from what I have read it could take weeks to sort this crap out. ... You may get your insurance from FedEx and a couple weeks later they find it and deliver it. ...
    (alt.photography)