1 Reply Latest reply on Sep 21, 2005 6:53 AM by Matteo

    CMP and jdbc-odbc bridge with MS Access

    Matteo Newbie

      Hi everone. I need some help.
      I'm developing a J2EE app. with Eclipse and JBoss 3.2.7.
      I have one cmp bean with two CMR with other cmp.
      I 've a session bean too for business logic and for accessing the cmp.
      I'm forced to use MS ACCESS 2003 via jdbc:odbc bridge.

      Well...the strange fact is that: I've created a remote console client (java application) for testing the CMP directly. In this case every things works fine, that is, i can do every getXXX from may Remote CMP EntityBean after the find.

      The problem come when I try to do the same thing from my Session Bean.
      In the Session bean I do really the same ...getContext for remote bean....getRemoteHome for my CMP EJB and finally findByPrimaryKey or findAll. When I try to use (i.e getSomePersistentField) one bean coming from the find I get this error:

      java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Query is too complex.

      Why from a console testClient it works fine and from a session bean it doesn't? I really used the same remote interface!

      Please help me if some one has had the same problem before.

      Thanx

        • 1. Re: CMP and jdbc-odbc bridge with MS Access
          Matteo Newbie

          More...I discovered that the problem comes up only if i call the findAll.
          I mean if I iterate on the primary key calling findByPrimaryKey everything works well. I can do every getXXX from my entityBean.

          But if I call the findAll and i iterate on the entityBean Collection I can only call the getPrimaryKey from the enity. Any other getXXX rise up the exception: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Query is too complex.

          Also if first I call findAll an after I try to call findByPrimaryKey it doesent work.

          What the hell is that?
          Please...help me..I'm going creazy!
          Thx.