Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase not getting dropped with hibernate3-maven-plugin
    text
    copied!<p>I'm using the hibernate3-maven-plugin to generate my schema before running tests, and it is successfully creating the schema, but is not successfully dropping it.</p> <p>My plugin configuration:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;hibernate3-maven-plugin&lt;/artifactId&gt; &lt;version&gt;2.2&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;process-test-classes&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;hbm2ddl&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;components&gt; &lt;component&gt; &lt;name&gt;hbm2ddl&lt;/name&gt; &lt;implementation&gt;annotationconfiguration&lt;/implementation&gt; &lt;/component&gt; &lt;/components&gt; &lt;componentProperties&gt; &lt;implementation&gt;jpaconfiguration&lt;/implementation&gt; &lt;persistenceunit&gt;JpaPersistenceUnit&lt;/persistenceunit&gt; &lt;configurationfile&gt;src/test/resources/hibernate.cfg.xml&lt;/configurationfile&gt; &lt;/componentProperties&gt; &lt;/configuration&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;mysql&lt;/groupId&gt; &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt; &lt;version&gt;5.1.5&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/plugin&gt; </code></pre> <p>My hibernate xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE hibernate-configuration SYSTEM "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; &lt;hibernate-configuration&gt; &lt;session-factory&gt; &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt; &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost/db_test&lt;/property&gt; &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt; &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt; &lt;property name="hibernate.connection.password"&gt;root&lt;/property&gt; &lt;property name="hibernate.connection.pool_size"&gt;1&lt;/property&gt; &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt; &lt;property name="hibernate.hbm2ddl.auto"&gt;create-drop&lt;/property&gt; &lt;/session-factory&gt; &lt;/hibernate-configuration&gt; </code></pre> <p>As you can see, I'm using hbm2ddl.auto=create-drop, which the documentation states should drop the db at SessionFactory close time.</p> <p>However, when I run my tests for the second time, I see the following Errors:</p> <pre><code>[ERROR] Error #1: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'stations' already exists [ERROR] Error #1: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'track_scans' already exists </code></pre> <p>(I currently only have two entities, so this seems appropriate)</p> <p>I'm not sure where to go from here. Any help would be appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload