I used file db as below:
spring.datasource.url=jdbc:h2:file:./data/meet
And I can find file "meet.mv.db" in my working directory.
If I add tuples to the file and restart the server, the size of the file increases. However, I cannot get what is inside the file after restarting. That means there is no persistency at all.
Can anyone help me to find how to obtain persistency?
In case you need my source code: https://github.com/jihunim/meet_n_eat_server
In application.properties:
spring.jpa.hibernate.ddl-auto=update
(from https://docs.spring.io/spring-data/jpa/docs/1.4.3.RELEASE/reference/html/jpa.repositories.html)
I ran into a similar problem and I discovered it was because I had this property set in the persistence.xml file:
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
Removing this line fixed the issue and data was still there after server restart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With