3 Replies Latest reply on Jan 18, 2004 6:21 PM by Victor Rotaru

    Firebird DDL problem

    Victor Rotaru Newbie


      "vrotaru" wrote:
      "vrotaru" wrote:
      "vrotaru" wrote:
      "vrotaru" wrote:
      jdk 1.4.2
      JBoss 3.2.3
      Firebird 1.5 RC8
      JayBird JCA connector 1.5 (latest)

      I have the following problem:


      Begin TX
      Issue DDL create table CUSTOMER
      Commit TX

      Check with isql: table CUSTOMER correctly created with proper constraints.

      Begin TX
      Issue DDL create table ORDERS which has a foreign key linked to the previous created table
      Commit TX
      On commit I got the following exception:


      15:04:36,182 WARN tm.TransactionImpl TransactionImpl logXAException() XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=localhost//407, BranchQual=] errorCode=XA_UNKNOWN(0)
      org.jboss.resource.connectionmanager.JBossLocalXAException: could not commit local tx; - nested throwable:
      (org.jboss.resource.JBossResourceException: SQLException; - nested throwable: (org.firebirdsql.jdbc.FBSQLException: Resource Exception. unsuccessful metadata update
      object CUSTOMER is in use
      Reason: unsuccessful metadata update
      object CUSTOMER is in use))
      at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.commit(TxConnectionManager.java:755)
      at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1593)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:375)
      at org.jboss.tm.TxManager.commit(TxManager.java:141)
      at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(EnterpriseContext.java:477)
      at com.brightsoft.mobilemaster.ejb.mgmtint.impl.ProvisioningEJB.createObject(ProvisioningEJB.java:1175)
      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:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:144)
      at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
      at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
      at $Proxy143.createObject(Unknown Source)


      open isql and run the CREATE TABLE ORDERS SQL but got the error:

      Statement failed, SQLCODE = -607

      unsuccessful metadata update
      -object CUSTOMER is in use

      Any help would be greatly appreciated.


        • 1. Re: Firebird DDL problem
          Adrian Brock Master


          "adrian@jboss.org" wrote:
          "adrian@jboss.org" wrote:
          "adrian@jboss.org" wrote:
          Sounds like a firebird issue to me.


          • 2. Re: Firebird DDL problem
            Ivan O. Parra Novice


            "ioparra" wrote:
            "ioparra" wrote:
            "ioparra" wrote:
            I'll agree with Adrian. I recommend creating a test case that mimics JCA to this adapter. With this test, you should be able to figure out what it takes to make these 2 DDL calls work. If you can't make it work, you know for sure it is Firebird. If you can, then see what Jboss' JCA is doing and compare your test against it. Only then can you really know if it is JBoss or Firebird.

            Good Luck.

            • 3. Re: Firebird DDL problem
              Victor Rotaru Newbie


              "vrotaru" wrote:
              "vrotaru" wrote:
              Sorry, I did not want to imply that this is a JBOSS problem as I use the same code for other 5 databases and it is working. I posted it here because I knew that the creator of the Firebird connector is answering posts on this forum and I
              hoped I will get a fast answer ;)
              It turned out to be a FireBird limitation in that you cannot create a foreign key on a table if you do not have an exclusive database access. I logged this issue with the FireBird people.
              Once again for the other readers: