Re: Closing Jet Database seems unreliable
- From: "William \(Bill\) Vaughn" <billvaRemoveThis@xxxxxxxxxx>
- Date: Mon, 5 Mar 2007 09:17:56 -0800
Could it be that JET has not finished writing the cache to the database?
Depending on how hard it has been pushed, there might be quite a bit of
uncommitted data there.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"Heinz Kiosk" <nospampleasetom.mcclelland@xxxxxxxxxxxx> wrote in message
news:qHRGh.7342$Yv5.6015@xxxxxxxxxxxxxxxxxxxxxxx
I am having difficulty getting Jet databases to close by calling the
DbConnection.Dispose method. The method seems to work, and the connection
state changes to closed, but about 25% of the time at some level the
process is keeping hold of the connection, and not deleting the ldb file
for example. Then when I terminate my process the ldb file gets deleted...
Or sometimes if I open and close a whole series of mdb's in sequence the
ldb's will build up and up then suddenly they'll all get deleted at once...
:-\
If I open my databases exclusively (mode-share exclusive) (for safety as
the app is single user) then if I close one and then reopen it in the same
process I'll often get a message that the database is already exclusively
open.
Suspecting that connection pooling was getting in the way I tried adding
"OLE DB Services= -1" or -4 to the connection string and curiously this
seems to make things worse. It virtually guarantees that the file will
remain open whereas with pooling turned on the closure seems to work about
75% of the time. In tests I can see no difference from my point of view
between the times when the call works and the times when the call fails.
Does anyone know a guaranteed way in ADO.NET of killing a connection to
Jet?
I want to do this so that my app can (for example) backup or restore the
Jet database from a menu prompt while the app is still running.
Is there any way of spying what is happening at the underlying Jet level?
Thank you for your help,
Tom
.
- Follow-Ups:
- Re: Closing Jet Database seems unreliable
- From: Heinz Kiosk
- Re: Closing Jet Database seems unreliable
- References:
- Closing Jet Database seems unreliable
- From: Heinz Kiosk
- Closing Jet Database seems unreliable
- Prev by Date: Re: import large text file
- Next by Date: Re: Closing Jet Database seems unreliable
- Previous by thread: Re: Closing Jet Database seems unreliable
- Next by thread: Re: Closing Jet Database seems unreliable
- Index(es):
Relevant Pages
|