Subject | RE: [firebird-support] Re: unsuccessful metadata update object is in use |
---|---|
Author | Alan McDonald |
Post date | 2004-04-28T23:31:22Z |
> String createSQL1 = "CREATE TABLE T1 (ID INTEGER NOTYou've created 2 connection but used only one - this may be a typo but in
> NULL PRIMARY KEY)";
> String createSQL = "CREATE TABLE T2 (ID INTEGER NOT
> NULL, FOREIGN KEY(ID) REFERENCES T1(ID) ON DELETE
> CASCADE)";
>
> Connection conn = DriverManager.getConnection(...);
> conn.setAutoCommit(false);
>
> Connection conn1 = DriverManager.getConnection(..);
> conn1.setAutoCommit(false);
>
> conn.createStatement().executeUpdate(createSQL1);
> conn.commit();
> conn.createStatement().executeUpdate(createSQL);
> conn.commit();
>
> It throws exception on the second commit(). So, I
> suppose, the problem still exists even after the
> explicit "commit" is being done.
any case - try disconnecting the first connection before establishing the
second and executing the statement.
Alan