I am new in Java EE and today I used JPA for the first time. I created a Java web app and deployed it to Openshift cloud on a Wildfly server using this tutorial: https://blog.openshift.com/build-and-deploy-cloud-aware-java-ee-6-postgresql-92-applications-inside-eclipse/
I have no idea why the server removed all inserted data, when I changed something in the app and turned off the server. How to prevent it? I want to insert data permanently, not for only one server session.
I used this function to insert data in the database:
public Foo insertFooToDatabase(Foo foo) {
entityManager.persist(foo);
return foo;
}