Restore via SQLDMO fails after ADO.NET access

S

Stefan Haubold

Hi,

I have written an utility that makes a backup (via SQLDMO) of a SQL
Server database, then issues various ADO.NET Commands to this
database. In case of any error it restores the database from the
backup (also via SQLDMO).

Problem is, when I want to do the Restore after an Error, the Restore
fails with the following error message "Exclusive access could not be
obtained".
I have made sure that all ADO.NET Commands close their respective
connections (via the using statement) so what am I missing here?

If I don't issue any ADO.NET Commands the Restore works just fine.

Stefan
 
B

Brett Keown [MSFT]

Hello Stefan,

Thanks for taking the time to post your question to the Microsoft
Newsgroups. I am not able to answer the question you are asking but will
identify an appropriate resource today and have someone respond to you as
soon as possible.

Thanks for your patience,

Brett Keown
Microsoft Support
(e-mail address removed)

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scot Rose [MSFT]

Hello Stefan, What happens if you wait several minutes after the last connection is closed before using DMO? Perhaps it is a pooling
issue. Do you have a small sample that reproduces the problem you are seeing?


Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.

Get Secure!
http://www.microsoft.com/security
http://www.microsoft.com/protect


--------------------
 
S

Stefan Haubold

Yes, pooling seemed to have something to do with it.

I solved it by deactivating Pooling (added "Pooling=False" to Connection
string) and explicitly destroying all ADO.NET Connections after use (via
Dispose()).

It works perfectly now.

Thanks for replying.

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top