1 Reply Latest reply on Apr 20, 2006 9:35 AM by Aaron

    hbm2ddl strips trailing semicolon from import.sql??

    Aaron Novice

      When deploying my application, I decided to include an import.sql file.

      The file is found and executed, but none of my data is in the DB. The PAR Deployer strips off the trailing semi-colon when executing, which tells MySQL the end of the command.

      The semicolon exists in the import.sql file, but in the server logs, the semi-colon is stripped off, and no data is in the DB. Hibernate doesn't complain though. As far as it's concerned it finishes with "Schema export complete".

      I have tried to escape the semicolon with the backslash (...VALUES ('blah')\; ) to no avail.

      Has anyone else had this trouble?

      Any workarounds?

      Thanks All!
      ~~Aaron

        • 1. Re: hbm2ddl strips trailing semicolon from import.sql??
          Aaron Novice

          Well, maybe it's not the trailing semicolon that is the problem.

          However, I still cannot get the import.sql to work correctly. According to hibernate, the export was successful. Unfortunately, according to my DB, nothing was ever done:

          MySQL 5.0.18
          JBoss-4.0.3SP1

          2006-04-20 09:26:19,940 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] Executing import script: /import.sql
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO user (id,username,dn,fname,lname,dispName,email,info_id) VALUES (1,'apaxson@mycompany.com','CN=APaxson,cn=people,dc=mycompany,dc=com',NULL,NULL,'Aaron Paxson',NULL,NULL)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO user (id,username,dn,fname,lname,dispName,email,info_id) VALUES (2,'aalig@mycompany.com','CN=Amy Alig,cn=people,dc=mycompany,dc=com',NULL,NULL,'Amy Alig',NULL,NULL)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO user (id,username,dn,fname,lname,dispName,email,info_id) VALUES (3,'bduenkelsbuehler@mycompany.com','CN=Benno Duenkelsbuehler,cn=people,dc=mycompany,dc=com',NULL,NULL,'Benno Duenkelsbuehler',NULL,NULL)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO request (id,created,completed,owner_id,requestor_id) VALUES (1,'2006-04-18 13:23:24',NULL,1,2)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO request (id,created,completed,owner_id,requestor_id) VALUES (2,'2006-04-18 13:24:02',NULL,1,3)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO ticket (id,status,resolution,problem,tech_id) VALUES (1,'Active',NULL,'Please degragment the BzQ SQL Server again. Things are running quite sluggish.',1)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO ticket (id,status,resolution,problem,tech_id) VALUES (2,'Active',NULL,'My blackberry is not working anymore.',1)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO note (id,comment,action,created,owner_id,request_id) VALUES (1,'Initial creation','Request Created','2006-04-18 13:23:24',1,1)
          2006-04-20 09:26:19,940 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] INSERT INTO note (id,comment,action,created,owner_id,request_id) VALUES (2,'Initial creation','Request Created','2006-04-18 13:24:03',1,2)
          2006-04-20 09:26:19,940 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] schema export complete
          


          This is really strange, and frustrating. Can anyone shed some light? The schema tables get built correctly, and the Entity Beans get mapped correctly. But, for some reason, my import.sql doesn't work.