I've my spring-boot application working with H2 DB on the file.
The current H2 db string is:
spring.datasource.url: jdbc:h2:./myApp-@project.version@;DB_CLOSE_ON_EXIT=TRUE
When I save my objects into the DB using the dao:
@Transactional public interface MyDao extends JpaRepository { }
myDao.save(new MyEntity(var1, var2);
and I stop my application with
SpringApplication.exit(applicationContext, exitCode);
everything is ok, at the next restart the DB contains the saved objects.
The problem is when I start the application, I save something in the DB and the java process is killed. At the next restart the saved datas are lost.
Can someone help me?
Thank you in advance!