Subject | Re: object tablename is in use |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-04-24T06:47:44Z |
Hi,
indirectly references this table. If you use connection pooling from
JayBird you have to disable statement pooling to be sure that closing
the connection will actually happen.
your application), open a new one, drop the table, commit. It is
always a good practice to do metadata changes when nobody is connected
to the database.
Roman
> I am trying to drop a table in Java and am having trouble withAny open connection in which you have open statement that directly or
> object tablename is in use message.
>
> Using:
> con.setAutoCommit(false);
> statement.executeUpdate("DROP TABLE tablename");
> con.commit();
> con.setAutoCommit(false);
>
> fails on the commit with the message 'object tablename is in use'.
>
> What exactly puts a table 'in use'
indirectly references this table. If you use connection pooling from
JayBird you have to disable statement pooling to be sure that closing
the connection will actually happen.
> and what code do you use to takeClose all connections to the database (not only all connections in
> it 'out of use'.
your application), open a new one, drop the table, commit. It is
always a good practice to do metadata changes when nobody is connected
to the database.
Roman