3 Replies Latest reply on Aug 29, 2003 5:18 AM by maciek

    wrong sql generated by jboss?

    maciek

      hello

      i switched my simple cmp from hypersonic to mysql and then get a strange exception
      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: Load failed; CausedByException is:
      Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key=1)' at line 1"

      how can i see this sql piece of code?

      what can be the cause of such exception?

      thanks

      ----
      also posted to cmp/persistence forum

        • 1. Re: wrong sql generated by jboss?

          Turn on DEBUG for org.jboss.ejb.plugins.cmp
          then look in log/server.log to see the generated queries.

          My guess is key is a reserved word in mysql
          or it could be the lower/upper case confusion.
          It is best to keep everything uppercase for portability.

          Regards,
          Adrian

          • 2. Re: wrong sql generated by jboss?

            Are you usiing XDoclet? If so, check your ejb.ejb.persistent-field and @ejb.persistence column tags make sure they preceed the correct abastract accessor methods. If not, please post your descriptors.

            Regards,

            Weston

            • 3. Re: wrong sql generated by jboss?
              maciek

              thanks
              actually the problem was that sql generated by jboss worked well with hypersonic and not with mysql
              i tried this sql with mysql cli and it turned out that a table column cannot be named 'key'

              so the problem was that i should have get some experience with the database i am using and not 100% rely on jboss sql :)

              regards