?
Solved

Connection is in use by another statement

Posted on 2003-03-03
10
Medium Priority
?
1,334 Views
Last Modified: 2013-11-23
Hi,

We've got an app which is generating "connection is in use by another statement" errors.  It uses a native BDE driver to communicate with SQL Server 2000.  If we use the ODBC SQL Server/BDE combination, it works fine.  Is there anyway we can rectify this, or are we forced to use the ODBC?

I've done a search on the net and no one has really had an answer which has solved ours or anyone elses problem.

Cheers!

Stu.
0
Comment
Question by:SJohnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 8062501
Maybe its time to move to ADO? ADO works nice and smooth with multiple DB clients.
ziolko.
0
 
LVL 1

Author Comment

by:SJohnson
ID: 8062512
Bit hard with 1,500+ BDE components litered throughout the application.  In the next version we'll be going multi-tiered, so it won't be an issue anymore.

Any suggestion on fixing the actual problem though?
0
 
LVL 21

Accepted Solution

by:
ziolko earned 400 total points
ID: 8062558
This error often occurs when there is more then 16 BDE Sessions(TSession) opened, we've fixed this by moveing to ADO, if thats too hard at the moment You can try pooling.
ziolko.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:SJohnson
ID: 8067771
I'll just turn on ignorance mode for a second... :)  I don't really understand sessions.  Can you explain it?  We just use one session - the default one.  Is a new session created for each Query/Table component, or will it always use the Default one?  My understanding was, for each new connection (ie, TDatabase) we should use a new TSession.

If we are getting too many sessions, why don't we get the same error when using the ODBC and a non-native BDE driver?

We seriously cannot move to ADO.  The amount of work it would be would far outweigh the benifits of it.  It would be easier for me to remove this part of the program than change to ADO.  So, it can't even be considered.

Thanks for the info,

Stu
0
 
LVL 9

Expert Comment

by:mocarts
ID: 8070733
Do you use threads in your app?
There is an issue with MS - you must fetch all results (with TQuery.FetchAll method) before executing another query.

maybe you run your app on multiprocessor machine? - BDE really don't like this. (http://bdn.borland.com/article/0,1410,27266,00.html)
mo.
0
 
LVL 1

Author Comment

by:SJohnson
ID: 8075331
Hi Mo,

No, this app is a single threaded app.  It also only runs on a single processor machine.

Cheers,

Stu.
0
 

Expert Comment

by:mfhobbs
ID: 8134294
There are lots of BDE Administrator settings under the Configuration tab which can be increased and might help.  I can't recall the exact ones but have a look under the driver you are using as well as the System/INIT node.  Look at increasing (e.g. doubling or more) the buffer sizes and memory sizes.  The defaults are too low for todays apps.  Go wild!

Cheers,
-Mat
0
 
LVL 1

Author Comment

by:SJohnson
ID: 8427648
This question is still active.  Sorry, I forgot about it.  The problem doesn't appear to be an issue anymore for some reason.

I'll give the points to ziolko because he was the first respondant.

Cheers,

Stuart.
0
 

Expert Comment

by:SnakeKatcher
ID: 9122282
I have noticed many folks who recommend ADO, but fail to recognize that it does not support MS SQL Server!
0
 

Expert Comment

by:SnakeKatcher
ID: 9122297
Sorry, I was confusing this with the DBExpress components, my bad....
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question