|
[
Permalink
| « Hide
]
Fergus McDonald added a comment - 05/Jan/07 02:29 PM
This would make external tables far more useful, particularly if you're using them as a way to import external data.. for example, if you want some other process ont he server to create the file, and then have firebird access it via external table.
External table's file will be closed when relation is not used by the engine.
I.e. when all requests referencing this relation are freed The external file is not being released.
steps to reproduce 1. Create External file 2. Create External table 3. create stored procedure to import the external table 4. run stored procedure ( wait till finished ) 5. call Windows.Deletefile to the original external file result windows error The process cannot access the file because it is being used by another process This task should mean when the external table is not being accessed there should be no file handle open on it. But firebird still has a file handle on it. Using Firebird 2.1 beta to test with Read coment above - "External table's file will be closed when relation is not used by the engine". And this is worked as written.
But procedure's request is not closed by the engine until procedure is in metadata cache. We'll look at it in v2.5 And don't post the same comment in two tickets, please No one is using the external file because the stored procedure is finished it's task.
Not sure what you mean by metadata cache. So then how can I delete the original external file? Currently I have a work around thankfully I can truncate the external file and rebuild upon it. When you execute procedure first time engine reads it metadata from disk, compiles BLR into execution tree and remembers (cached) this info as compiled request. This compiled request remains in metadata cache until shutdown or drop\alter procedure. Therefore this request didn't release its interest in used resources (tables, indexes, procedures etc) and engine don't closed external table's file.
If you would work with external tables not via procedures, engine (since v2.1) will close external table's file as soon as all interested requests are closed by your application. So as workaround you may use EXECUTE BLOCK instead of stored procedures for work with external tables in v2.1. Not perfect, i know, but we can't improve this in v2.1 as it is at near release candidate state. If you did this report at beta1 stage i sure we would fix it at that time. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||