5 Replies Latest reply on Jun 21, 2007 3:27 AM by Antoine Herzog

    JBP2.6RC2 - MySQL5 : SQL Warning: 1051, SQLState: 42S02

    Antoine Herzog Master

      When suppressing all the tables in the database, and relaunching the server, I got many :

      SQL Warning: 1051, SQLState: 42S02


      according to :
      http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=78&t=002465
      and
      http://forum.springframework.org/showthread.php?p=95493

      it seems that the hibernate3 that comes with JBP 2.6 (jboss as 4.0.5) is not detecting properly the dialect for MySQL5.

      I set hibernate3.2.4.sp1.jar (latest version at hibernate.org) in the lib folder, and it is working fine.

      I was working with JBP 2.4.1SP1 with hibernate3.2.3.ga.jar (for using EJB3, annotation with hibernate-annotations-3.3.0.ga.jar, etc...), with no problem.

      open a Jira for that ? for an tip in the documentation ?


        • 1. Re: JBP2.6RC2 - MySQL5 : SQL Warning: 1051, SQLState: 42S02
          Thomas Heute Master

          Is it breaking or just issuing a WARN ?

          I think it passes all the test here on MySQL5 i would have to check.

          • 2. Re: JBP2.6RC2 - MySQL5 : SQL Warning: 1051, SQLState: 42S02
            Antoine Herzog Master

            It run in circle, logging many lines of this and "table not found 'this_table'".
            I stopped it with Ctrl+C.
            May be it would end, after a while, but I let it go quiet a while before to stop it.

            What I did, roughly :
            install from the bundled package
            check it works (nice !!!)
            suppressed all the tables with a sql script
            restart the server (several try, with also suppressing the tmp and work folders of jboss).

            I ll provide the script for erasing the tables when it is finished (quiet more complicated with the new jbpm tables, and I had to pause to resolve this before, and took the opportunity to install the latest hibernate version...).

            • 3. Re: JBP2.6RC2 - MySQL5 : SQL Warning: 1051, SQLState: 42S02
              Prabhat Jha Master

              We use mysql5 for testing before each release of portal and we have not have to explicitly set hibernate dialect. We also have daily runs of testuite with mysql5 along with six other databases and all seem to be going well. If you only see warning, then it's okay.

              • 4. Re: JBP2.6RC2 - MySQL5 : SQL Warning: 1051, SQLState: 42S02
                Thomas Heute Master

                Antoine, I don't understand.


                What I did, roughly :
                install from the bundled package
                check it works (nice !!!)


                With the embedded Hypersonic or after changing to MySQL ?


                suppressed all the tables with a sql script


                With hypersonic you can simply drop /server/default/data
                With mySQL do:
                drop database jbossportal;
                create database jbossportal;



                • 5. Re: JBP2.6RC2 - MySQL5 : SQL Warning: 1051, SQLState: 42S02
                  Antoine Herzog Master

                  I did :
                  - installation
                  - setting of datasource preference : MySQL5
                  - then testing it is ok
                  - etc...
                  I set the datasource to MySQL5 only for PortalDS.
                  I have let the hypersonic db for the DefaultDS (for the time being, but will put it in MySQL5 later... more clean for prod).

                  About drop database :
                  the scripts are several : one for "all the database", and some for deleting specifically the CMS part, the user and role part, the Portal part.

                  When developping, I usually "erase" only the Portal part.
                  And keep safe the CMS and Users/Roles parts.

                  This to clean the portal description (when playing with new windows/instances/portlets), but KEEP all the data of the CMS and all the users I need for my tests.
                  Can't recreate all this each time.

                  That's why I do not drop the whole DB.

                  By the way, I used to do some "delete" of records rather than "drop table" : avoid to recreate the tables... quicker when relaunching the server... which may be several time per hours, when playing with new windows, instances, and portlets.

                  With JBPM, the tables are strongly in relation with foreign keys. It seems not possible to just suppress the records (the jbpm objects/instances).
                  Do you know a way to do that ?
                  (may be it will not be something to do oftenly, like Users/Roles part... but just to know).