Note that there are some explanatory texts on larger screens.

plurals
  1. POH2 in-mem-DB with hibernate set to create giving me table not found errors
    primarykey
    data
    text
    <p>I wanted to set up a project with hibernate, spring mvc and H2 as (for now) in memory DB. When everything boots up (in jetty) I get errors saying that the tables aren't yet present.</p> <p>This is the error I get:</p> <pre><code>Okt 09, 2013 3:42:47 PM org.hibernate.tool.hbm2ddl.SchemaExport execute INFO: HHH000227: Running hbm2ddl schema export Okt 09, 2013 3:42:47 PM org.hibernate.tool.hbm2ddl.SchemaExport perform ERROR: HHH000389: Unsuccessful: alter table PUBLIC.Object drop constraint FK_9sd2x4ehbugdjyrp1xqmsjw00 Okt 09, 2013 3:42:47 PM org.hibernate.tool.hbm2ddl.SchemaExport perform ERROR: Tabelle "OBJECT" nicht gefunden Table "OBJECT" not found; SQL statement: ... </code></pre> <p>This would be OK if I hadn't set Hibernate such as this:</p> <pre><code>hibernate.hbm2ddl.auto=create </code></pre> <p>and the connection string for H2 is this:</p> <pre><code>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=TRUE </code></pre> <p>I can connect to the DB using IntelliJ so it is there..</p> <p>I expected Hibernate to generate the tables for me and then the constraints and whatever else follows but for some reason it doesn't do that. Could it be a user rights thing? these are the user settings i set up:</p> <pre><code>jdbc.user=sa jdbc.pass= </code></pre> <p>Any help is appreciated! Thanks :)</p> <p><strong>UPDATE</strong></p> <p>If i change the connection string to this:</p> <pre><code>jdbc.url=jdbc:h2:~/db/database.db;DB_CLOSE_ON_EXIT=TRUE;INIT=create schema IF NOT EXISTS generic; </code></pre> <p>it seems to work. But why it doesn't work in memory and why it didn't work before when i set the default schema to "public" (which was there already so i figured might as well just dump my stuff in there...) IDK!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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