3 Replies Latest reply on Dec 1, 2003 9:30 PM by sys user

    what should I do with such excption?

    sys user Master

      ms access jdbc-odbc,
      pk: itemID (Integer)

      cmp finder:
      select from Object(b) from item where customerID = ?1

      customerID: Integer

      problem:

      when result num of finder less than 102, all ok. but if result num of finder more than 103, a exception throw out as below:

      org.jboss.tm.JBossTransactionRolledbackException: Load failed; CausedByException is:
      [Microsoft][ODBC Microsoft Access Driver] Query is too complex.; CausedByException is:
      Load failed; CausedByException is:
      [Microsoft][ODBC Microsoft Access Driver] Query is too complex.; nested exception is:
      javax.ejb.EJBException: Load failed; CausedByException is:
      [Microsoft][ODBC Microsoft Access Driver] Query is too complex.; - nested throwable: (javax.ejb.EJBException: Load failed; CausedByException is:
      [Microsoft][ODBC Microsoft Access Driver] Query is too complex.)
      at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:262)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      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 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.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
      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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: javax.ejb.EJBException: Load failed; CausedByException is:
      [Microsoft][ODBC Microsoft Access Driver] Query is too complex.
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:237)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:76)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:577)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:559)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:381)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:352)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:239)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:114)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:163)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      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.EntityContainer.internalInvoke(EntityContainer.java:490)
      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.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy35.getOrdersData(Unknown Source)
      at com.learn.session.EmployeeBean.getOrdersByEmployee(EmployeeBean.java:76)
      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.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      ... 21 more


      regards.

        • 1. Re: what should I do with such excption?
          imaya Newbie

          Hi!

          Your select construct

          select from Object(b) from item where customerID = ?1

          is kind of odd. It should look like

          SELECT OBJECT(obj)
          FROM item obj
          WHERE obj.customerID =?1

          • 2. Re: what should I do with such excption?
            sys user Master

            sorry, it's my wrong key-pressed.
            the query is :

            select from Object(b) from item b where b.customerID = ?1

            the problem is still .......

            • 3. Re: what should I do with such excption?
              sys user Master

              in fact , invoker is :

              1-Collection a = ItemLocalHome.findByCustomerID(customerID);
              2-Iterator it = a.iterator();
              3-while (it.hasNext()) {
              4- ItemLocal myItems = (ItemLocal) it.next();
              5- result.add(myItems.getItemData());
              6-}

              excepion throws from ----- 5 ----------

              when customerID=2
              the result num is 96, no any problem.

              when customerID=3
              the result num is 127 . exception throws

              when getItemData().....
              it'll get data by execute query like:

              selecet a,b,c,d from XXX where (itemID=?) or (itemID=?) or (itemID =?)........

              set the PKs to the query string, then execute it .

              when num of PK more than 103. throws the exception (query is too complex..)

              maybe , it's ms access jdbc-odbc 's limit. I don't know if this will occurs with other jdbc-odbc driver? or other DB driver?

              I wonder if I can do sth to avoid that in jboss?