Subject Re: [Firebird-Java] Unsuccessful metadata update - Solution
Author Ranjith T R
Hi,

I also faced the same problem.
I use the latest jaybird driver -JayBird JCA/JDBC
Driver v 1.5.4 with earlier versions i was facing the
same problem .and i am used DBMAE.fdb format instead
of DBNAME.gdb format .and one more thing i explicitly
set
setAutoCommit(true); Just try this and if there is
problem feel free to mail me

rgds
Ranjith T R <ranjith@...>



--- iliyakrapchatov <iliyakrapchatov@...> wrote:

>
>
> Hi!
>
> I just found out some problem with cached metadata
> (?) in driver.
> Next simple code:
>
> import org.apache.log4j.*;
> import java.sql.*;
>
> public class Test {
> static Logger logger =
> Logger.getLogger(Test.class);
> public static void main(String[] args) {
> BasicConfigurator.configure();
> try {
> Class.forName
> ("org.firebirdsql.jdbc.FBDriver");
> Connection con = DriverManager.getConnection
>
("jdbc:firebirdsql:localhost/3050:c:/Projects/Bap/Bap.gdb","SYSDBA","m
> asterkey");
> Statement st = con.createStatement();
> st.executeUpdate("CREATE TABLE t1(id INTEGER
> NOT NULL PRIMARY
> KEY)");
> st.executeUpdate("CREATE TABLE t2(pkref
> INTEGER REFERENCES t1
> (id))");
> } catch (Exception e) {
> logger.error("Abnormal termination", e);
> }
> }
> }
>
> fails with this exception:
>
> 0 [main] ERROR Test - Abnormal termination
> org.firebirdsql.jdbc.FBSQLException: Resource
> Exception. unsuccessful
> metadata update
> object T1 is in use
> Reason: unsuccessful metadata update
> object T1 is in use
> at
>
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> (AbstractConnection.java:872)
> at
>
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> (AbstractConnection.java:856)
> at
> org.firebirdsql.jdbc.AbstractStatement.executeUpdate
> (AbstractStatement.java:205)
> at Test.main(Test.java:20)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> com.intellij.rt.execution.application.AppMain.main
> (AppMain.java:78)
> at
> org.firebirdsql.gds.GDSException: unsuccessful
> metadata update
> object T1 is in use
> at org.firebirdsql.jgds.GDS_Impl.readStatusVector
> (GDS_Impl.java:1761)
> at org.firebirdsql.jgds.GDS_Impl.receiveResponse
> (GDS_Impl.java:1714)
> at
> org.firebirdsql.jgds.GDS_Impl.isc_commit_transaction
> (GDS_Impl.java:589)
> at
>
org.firebirdsql.jca.FBManagedConnectionFactory.commit
> (FBManagedConnectionFactory.java:686)
> at
>
org.firebirdsql.jca.FBManagedConnection.internalCommit
> (FBManagedConnection.java:409)
> at
>
org.firebirdsql.jca.FBLocalTransaction.internalCommit
> (FBLocalTransaction.java:155)
> at
>
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> (AbstractConnection.java:866)
> at
>
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> (AbstractConnection.java:856)
> at
> org.firebirdsql.jdbc.AbstractStatement.executeUpdate
> (AbstractStatement.java:205)
> at Test.main(Test.java:20)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> com.intellij.rt.execution.application.AppMain.main
> (AppMain.java:78)
>
> Additionally I've tried many cases (autocommit=off,
> closing
> connection etc.) and found no way to create two
> tables one relates to
> another.
>
> The same query sequence through IBconsole works
> fine.
>
>
>
>
>
>
>




__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com