Subject Re: [firebird-support] Re: unsuccessful metadata update object is in use
Author Martijn Tonies
Hi,

> >> Thanks once again for your reply. I'm still unable to understand the
> >> rational behind the behavior. Let me try with the direct firebird
> >> ("paid") support and see if I can gather more details in this regard.
>
> > It was some kind of design decision. It undoubtely has to do
> > with multi-versioning and concurrency etc etc of records. And
> > therefor, simply: safety reasons.
>
> Here's what I found by doing a search in the Firebird Lists on IB
> Phoenix:
>
> >From Claudio, 14-mar-2002:
>
> "Object in use is different than exclusive access to db is need or
secondary
> attachments cannot validate db.
> Object in use means that in the same session, you did a select (probably
an
> update, delete, insert as the same effect) on a table or procedure that's
> going to be altered. There are two solutions:
> - You do a hard, explicit COMMIT. Autocommit and commit retaining don't
> work. Most of the time a hard commit works.
> - You play safe and detach. If there's no other attachment, this action
> ensures the engine itself unloads the db from memory and frees the file
> handles associated with it. Next time you connect, your metadata change
> should succeed immediately."

Disagreed -- when creating a FK, you will get the "object in use"
as well, if there are more than 1 connections to the db. Even without
a SELECT on the tables involved.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com