This content has been marked as final.
Show 2 replies
-
1. Re: Getting MySQL to create tables
robaks Sep 6, 2005 10:01 AM (in response to robaks)<entity-manager> <name>articles</name> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/articles</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> <property name="hibernate.case.use_query_cache">true</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.hbm2ddl.auto">create</property> <property name="hibernate.connection.datasource" value="java:/articles"/> </properties> </entity-manager>
-
2. Re: Getting MySQL to create tables
chrismalan Sep 6, 2005 7:51 PM (in response to robaks)Thanks Robaks,
How on earth did you find out about adding that line? An old Hibernate hand?
Updating to the 3.1.X driver also did it. However, there is now another problem. Tables are created and entries persisted, but on restarting the server the table is empty again. No doubt the SQL code generated to create the tables check for table existence (if exists), drops them if they exist and recreates them.
This is of course a serious problem. One would be very unhappy in a production environment if the server goes down and all tables are empty on restart. Another argument in favour of a back-up protocol.
I'll post on this one and see what comes up.
Thanks again.