Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1350
  • Last Modified:

Connection is in use by another statement

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
SJohnson
Asked:
SJohnson
  • 4
  • 2
  • 2
  • +2
1 Solution
 
ziolkoCommented:
Maybe its time to move to ADO? ADO works nice and smooth with multiple DB clients.
ziolko.
0
 
SJohnsonAuthor Commented:
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
 
ziolkoCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
SJohnsonAuthor Commented:
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
 
mocartsCommented:
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
 
SJohnsonAuthor Commented:
Hi Mo,

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

Cheers,

Stu.
0
 
mfhobbsCommented:
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
 
SJohnsonAuthor Commented:
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
 
SnakeKatcherCommented:
I have noticed many folks who recommend ADO, but fail to recognize that it does not support MS SQL Server!
0
 
SnakeKatcherCommented:
Sorry, I was confusing this with the DBExpress components, my bad....
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now