Re: Remaining connections after Execute?
From: Darren Green (darren.green_at_reply-to-newsgroup-sqldts.com)
Date: 03/24/04
- Next message: K: "RE: How to read a row from input and pass it stored proc/SQL statement"
- Previous message: Darren Green: "Re: Custom Task Confusion"
- In reply to: Geert Doornbos: "Remaining connections after Execute?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 20:52:50 +0000
In message <fbd6df9f.0403241150.5abf256@posting.google.com>, Geert
Doornbos <geert.doornbos@planet.nl> writes
>I'm currently running a DTS package from an Installer class (.NET) and
>the execution succeeds. There is transformation/copying taking place
>from one database to another database. Directly after executing the
>package (using package2class interop class) I'm trying to drop the
>first database in the same process space (installutil.exe). This does
>not work: SqlException: cannot drop database; currently in use.
>Execution of SQL statement 'DROP DATABASE' seems to stall, then the
>exception appears after about 15 sec. When the InstallUtil process
>ends I can drop the database.
>I've tried package/step options like 'close connection on completion',
>execute on main thread', disabled 'using a transaction', etc. but I
>still can't drop the database. I made sure the DTS package object was
>released after execution (even did a garbage collection).
>
>Anyone any suggestions?
>
>
>Thanks for your help
>
>Geert
Have you tried running a Profiler trace to see what the DTS connections
are doing?
Have you tried querying sysprocesses or running sp_who2 to see what
connections are in the DB?
Some things to try and ensure that DTS closes everything-
Use Close Connection On Completion
Call the Uninitialize method on the package after execution
Use Marshal.ReleaseComObject to release the (package) COM object. GC is
very unpredictable when playing through RCWs.
-- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org
- Next message: K: "RE: How to read a row from input and pass it stored proc/SQL statement"
- Previous message: Darren Green: "Re: Custom Task Confusion"
- In reply to: Geert Doornbos: "Remaining connections after Execute?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|