JacobBosma (4) [Avatar] Offline
#1
I an (trying) to run this

mvn -pl helloworld -Dtest=org.jpwh.test.helloworld.HelloWorldTestJPA#storeLoadMessage -DexternalH2=true clean test

against mysql database.
Do not be mislead by -DexternalH2, I changed in in JPASetup.java to always use "org.hibernate.dialect.MySQLDialect".

using newest mysql connector.

Table creation works.
But test is hanging.
MySql : show full processlist shows :
mysql> show full processlist;
+----+------+-----------------+------+---------+------+---------------------------------+------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------------+------+---------+------+---------------------------------+------------------------------+
| 18 | root | localhost | test | Query | 0 | NULL | show full processlist |
| 19 | root | localhost:50747 | test | Sleep | 136 | | NULL |
| 20 | root | localhost:50748 | test | Query | 136 | Waiting for table metadata lock | drop table if exists Message |
+----+------+-----------------+------+---------+------+---------------------------------+------------------------------+
3 rows in set (0.00 sec)
If I kill process 19 mvn test continues.
Do not understand why.
'commit' in HelloWorldTestJPA.java seems fine to me.
Christian Bauer (56) [Avatar] Offline
#2
Re: hanging on mysql
I don't test on MySQL, for now H2 is the only supported database of the examples. You are on your own.
JacobBosma (4) [Avatar] Offline
#3
Re: hanging on mysql
My fault.
Configuration error : using both hibernate and JPA to create / drop tables;

<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
and
properties.put("javax.persistence.schema-generation.database.action","create");

Works fine now on MySql.