I am running a MySQL 5.1 server and Hibernate 3.5.1 / JPA2 for ORM. Everthing seems fine until I drop some tables manually. From then on, unit tests fail with Hibernate no longer creating certain tables. Changing the jdbc url from
url=jdbc:mysql://localhost:3306/dbjava?createDatabaseIfNotExist=true
to
url=jdbc:mysql://localhost:3306/dbjavanew?createDatabaseIfNotExist=true
solves the problem ... until I perform some table drops :-( Since I am going to use MySQL for production, this must not happen at all.
Dropping dbjava does not help too. Any suggestions?
--- ADDITIONAL INFO:
It's getting really weired. From mysql console:
mysql> use dbjava;
Database changed
mysql> show tables;
+---------------------+
| Tables_in_dbjava |
+---------------------+
| aa |
| ba |
| da |
| ea |
| hibernate_sequences |
| ia |
| ka |
| la |
+---------------------+
8 rows in set (0.00 sec)
mysql> create table `cA` (id integer not null, comment varchar(255), name varchar(255), id_d integer, id_f integer, primary key (id)) ENGINE=InnoDB;
ERROR 1050 (42S01): Table 'ca' already exists
Uh? Why does Table 'ca' exist?!?!? Actually, it once existed ... since then, it was dropped, the whole db was dropped several times ... why does it still exist?
Even worse:
mysql> drop table cA;
mysql> ERROR 1051 (42S02): Unknown table 'ca'
Totally confused ...
However, I just realised something: my table names in hibernate use lower and upper case (camel case) notation. mysql responses lower case only. Would anybody confirm that mysql does not recognize case-sensitiveness in the year 2010 ?!?