Subject | Re: [Firebird-Java] Unsuccessful metadata update - Solution |
---|---|
Author | karthick srini |
Post date | 2004-11-16T06:51:56Z |
Hi ,
Firebird by default , when there are more connection
to DB it won't allow to create FK. While running your
java program you would have kept open isql prompt.
While Java VM has opened connection it would have been
the second one and caused the problem.
I have discussed this much in firebird-support and in
firebird-architect forums. Search those forums with
the subject title "multi connection" for more details.
Even this is documented in FAQ of firebirdsql.org
(Documentation --> FAQ)
This is nothing to do with jaybird driver. It is
firebird DB related issue.
S.Karthick
--- Ranjith T R <ranjith_tr@...> wrote:
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
Firebird by default , when there are more connection
to DB it won't allow to create FK. While running your
java program you would have kept open isql prompt.
While Java VM has opened connection it would have been
the second one and caused the problem.
I have discussed this much in firebird-support and in
firebird-architect forums. Search those forums with
the subject title "multi connection" for more details.
Even this is documented in FAQ of firebirdsql.org
(Documentation --> FAQ)
This is nothing to do with jaybird driver. It is
firebird DB related issue.
S.Karthick
--- Ranjith T R <ranjith_tr@...> wrote:
>("jdbc:firebirdsql:localhost/3050:c:/Projects/Bap/Bap.gdb","SYSDBA","m
> 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
> >
>
> > asterkey");org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> > 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
> >
>
> > (AbstractConnection.java:872)org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> > at
> >
>
> > (AbstractConnection.java:856)org.firebirdsql.jca.FBManagedConnectionFactory.commit
> > 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
> >
>
> > (FBManagedConnectionFactory.java:686)org.firebirdsql.jca.FBManagedConnection.internalCommit
> > at
> >
>
> > (FBManagedConnection.java:409)org.firebirdsql.jca.FBLocalTransaction.internalCommit
> > at
> >
>
> > (FBLocalTransaction.java:155)org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> > at
> >
>
> > (AbstractConnection.java:866)org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction
> > at
> >
>
> > (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
>
>
>
>
>
>
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com