Subject Re: [firebird-support] Re: unsuccessful metadata update object is in use
Author Helen Borrie
At 09:20 AM 28/04/2004 +0000, you wrote:

>Anyways, normally the create statement(or any ddl statement for that
>matter) are auto-commit by nature.

Really? Where did you get that from? AutoDDL is an isql setting. It's on
by default when you start an isql session, or if you issue an isql command
from a command shell; but in isql (and in scripts that are run in isql)
you can vary that behaviour by using SET AUTODDL OFF.

What happens under the hood is that isql starts a read committed
transaction for each DDL command it receives, and commits it upon execution
of the single statement (unless there is an exception). It's a
client-initiated thing, just like all transactions.

If you are also running DML statements in the same session, they are in a
separate transaction (by default, in snapshot isolation). You have to
commit DML yourself.

>I checked the behavior in firebird and it works this way only.

Only in isql and only if autoddl is on.

>In fact, the firebird offers
>ways to 'disable' this behavior too (by doing a set AutoDDL, which
>toggles the auto commit of ddl statements).

*firebird* doesn't; but the program isql.exe does.

If you are issuing a DDL command as a regular DSQL statement (as you are
doing in your Java code) then there is *no* autoddl, since autoddl is an
isql thing, it's not part of the DSQL statement set.

>So, I'm not sure whether commit will help solve this problem.

>Although I tried it (more out of curiosity) and got the same "object
>is in use" error message (as expected).

Then there is definitely something in your environment that you're not
telling us about.

/heLen