mfudi
mfudi

Reputation: 799

Can't connect to H2 database in automatic mixed mode

I have the following config in the persistence.xml of my jpa app:

<properties>
        <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
        <property name="javax.persistence.jdbc.url" value="jdbc:h2:c:/workdir/db/dev;AUTO_SERVER=TRUE"/>
        <property name="javax.persistence.jdbc.user" value=""/>
        <property name="javax.persistence.jdbc.password" value=""/>
<properties>

I suppose it's called 'Automatic Mixed Mode' and i should be able to access it using the jdbc:h2:file:c:/workdir/db/dev url in the h2 console.

I start the h2 console:

java -jar h2-1.3.172.jar -url jdbc:h2:file:c:/workdir/db/dev

Then i see only INFORMATION_SCHEMA and no tables created by my app.

What's wrong ?

Upvotes: 0

Views: 1014

Answers (1)

mfudi
mfudi

Reputation: 799

Ok, it's because the jpa app is using a different version of h2 jar. So the fix is to use the same versions of h2 jar everywhere.

Upvotes: 1

Related Questions