Memory and handle problems with CDatabase

Greetings,

my program uses CDatabase and CRecordset objects in multiple threads and very frequently. The problem is that memory doesn't seem to be released when I close the database. I do see memory decreasing when I close my recordset objects but not the database.
Also, everytime I call CDatabase->ExecuteSQL for an INSERT query the memory and handle count goes up. Is there some other mehod that has to be called to release resources. Note that I am using CDatabase to connect to a MS Access database via ODBC because it is more thread safe that CDaoDatabase.

Thanks.
sinisterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nicolay_ChCommented:
May be you need to simple call CDaoDatabase->Close()?

Before CRecordset->Close()?

0
alechkoCommented:
As said in MSDN then you close the database, it's not released, you can use it again and reopen the connection..
it's for perfomance reasons, some applications always keep connection open, so they have to check if the database is still accessible (mostly with SQL servers which can fall down for a strange reason), some applications always close it's connection to database, so next time you connect, you'll know if database is alive. So in both cases perfomance will be almost the same since CDatabase keeps it's instance unless you destroy it manualy (new and delete). By just closing it will not release the resources it takes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sinisterAuthor Commented:
Well, so far our stress testing seems to be going well, I keep the database open all the time. Is there a timeout without the connection that I should be concerned with? Also, if you know of any potential problems that can occur with MS Access through ODBC and CDatabase, I would appreciate it.

Thanks.
0
alechkoCommented:
I don't think, I cant see any reason that Access database will not respond, maybe if someone deletes it ?!

Problems... can't think of something...
As far as I know there are some limits of Access database comparing to SQL Server, like the size, number of tables, security... and the most problematic is the speed and number of connections at the same time.

CDatabase & CRecordset works just fine.

Have fun.
0
alechkoCommented:
I don't think, I cant see any reason that Access database will not respond, maybe if someone deletes it ?!

Problems... can't think of something...
As far as I know there are some limits of Access database comparing to SQL Server, like the size, number of tables, security... and the most problematic is the speed and number of connections at the same time.

CDatabase & CRecordset works just fine.

Have fun.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.