Re: Re: [sqlite] Detached database still owned by process

2006-11-29 Thread Anders Holmberg

Thanks for the responses.

The ProcessExplorer was just the thing I needed! With it I can see
that sqlite _does_ release the file handle and that my program must
hold on to it in another way sometimes. Now I have to find that
sometime;)

Thanks again...

/Anders

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Detached database still owned by process

2006-11-29 Thread Trevor Talbot

Sysinternals' Process Explorer can be used to verify that your process
does indeed still have a handle to the file, or search for another
process that does, if you need it.

http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx

In the .NET application case, make sure (when using managed I/O) that
an explicit .Close() or .Dispose() is being done; don't rely on GC.
This doesn't apply to an sqlite wrapper in the detach case, though.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Detached database still owned by process

2006-11-29 Thread drh
"Anders Holmberg" <[EMAIL PROTECTED]> wrote:
> Hi
> 
> I am using sqlite (version 3.3.7) on Windows and I am loading one database
> (stored in a file) into another database (:memory:) using the attach /
> detatch scheme described on the sqlite site.
> 
> My problem is that sqlite keeps hanging on to the first database even after
> I have made a detach; which makes it impossible for me (or my program) to
> delete the original file.
> 
> Is there something more I need to do make sqlite "forget" about the file?
> 

Unable to reproduce.  "lsof" shows that sqlite3 closes the
file handle just fine when you detach on linux. Perhaps your detach
is failing.  What does "PRAGMA database_list" show after the
detach?
--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Detached database still owned by process

2006-11-29 Thread Anders Holmberg

Hi

I am using sqlite (version 3.3.7) on Windows and I am loading one database
(stored in a file) into another database (:memory:) using the attach /
detatch scheme described on the sqlite site.

My problem is that sqlite keeps hanging on to the first database even after
I have made a detach; which makes it impossible for me (or my program) to
delete the original file.

Is there something more I need to do make sqlite "forget" about the file?

Anders Holmberg