Too many database connections 
Author Message
 Too many database connections

We are using Delphi to access SQL Server 6.5, and the app uses a lot of
tables - main tables, lookup tables, etc. Delphi apparently creates one
user connection for every table, plus a bunch of others just for good
measure. So one user running the app is taking up close to 50 user
connections!

Why is Delphi being so stupid, and is there any way to train it?

Thanks in advance!

-- Charlie

P.S. I also notice it creates a phenomenal number of select statements -
stuff it really shouldn't need. Any clues about that?



Wed, 18 Jun 1902 08:00:00 GMT
 Too many database connections

Congratulations, youve just stumbled on the most anoying problem with
TTables that has been around since Delphi 1. The bottom line is that
TTables were not designed to be used with
C/S or SQL databases.
Unfortunatly what you must do is use TQuery components, routed through a
TDatabase component. that keeps the number of connections down to 1, or as
many TDatabases that you have.

It is a pain in the {*filter*}to rewrite all your stuff to use queries, but I
dont think that there is any other solution (And believe me... I looked).
However, you will find that once you got your queries working, your
aplication will also run much faster.

Good luck

Roman Vinnik

---------------------



Quote:
> We are using Delphi to access SQL Server 6.5, and the app uses a lot of
> tables - main tables, lookup tables, etc. Delphi apparently creates one
> user connection for every table, plus a bunch of others just for good
> measure. So one user running the app is taking up close to 50 user
> connections!

> Why is Delphi being so stupid, and is there any way to train it?

> Thanks in advance!

> -- Charlie

> P.S. I also notice it creates a phenomenal number of select statements -
> stuff it really shouldn't need. Any clues about that?



Wed, 18 Jun 1902 08:00:00 GMT
 Too many database connections

Drop a tdatabase on to the form and hook all of the ttables into the 1
tdatabase.  The tdatabase will make 1 connection with the server.

Quote:

> We are using Delphi to access SQL Server 6.5, and the app uses a lot of
> tables - main tables, lookup tables, etc. Delphi apparently creates one
> user connection for every table, plus a bunch of others just for good
> measure. So one user running the app is taking up close to 50 user
> connections!

> Why is Delphi being so stupid, and is there any way to train it?

> Thanks in advance!

> -- Charlie

> P.S. I also notice it creates a phenomenal number of select statements -
> stuff it really shouldn't need. Any clues about that?



Wed, 18 Jun 1902 08:00:00 GMT
 Too many database connections

Quote:

> We are using Delphi to access SQL Server 6.5, and the app uses a lot
> of
> tables - main tables, lookup tables, etc. Delphi apparently creates
> one
> user connection for every table, plus a bunch of others just for good
> measure. So one user running the app is taking up close to 50 user
> connections!
> -- Charlie

Hi Charlie

I am using Oracle and I use a single TDatabase and route all TTables and

TQueries through it which seems to work fine - it also makes changing
the database location easy.

John



Wed, 18 Jun 1902 08:00:00 GMT
 Too many database connections

Quote:


> > P.S. I also notice it creates a phenomenal number of select statements -
> > stuff it really shouldn't need. Any clues about that?

You need to enable schema caching in the BDE.  Otherwise it looks for a
bunch of metadata every time you connect.


Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. sql 2000 iis 5 ado database connection problem -- connections slow

2. Multi User Connection via COM for database connection

3. Multi User Connection via COM for database connection

4. Oracle 7.3.2 Connection problem : very long time to get a database connection

5. Pro*C Database connection - How do I identify a connection

6. Renaming a Database Connection and Database

7. HELP: sharing database connection (like Delphi and Database Explorer)

8. Refreshing the Database Connection

9. The Database Connection is in Disconnected State

10. *** Please help: Web database connection ***

11. How to detach ResultSet from database connection?

12. Why does dll make a database connection fail?


 
Powered by phpBB® Forum Software