First I want to say that Im in a programming school atm, and in the course called project development I received a half finished project from seniors to continue. So needless to say I dont know the project by heart and that paired with my inexperience, I hope you can forgive my possibly stupid questions.
It is a Maven Web Application, the language used is Java. The database is a simpe JAVA DB (Derby), the server is Glassfish 4.0. Both are used within the Netbeans 8.0 environment.
Now to the actual problem. The App is a online Questionnaire creation tool, so the user can create Questions, answers, upload a picture etc.. And it does work, everything is stored in the DB and persisted, I checked manually and the data is there and stays there after closing the App. However as soon as I re-launch the App, all DB content is lost. Yet not quite entirely, it seems that only the ID gets deleted, since when I upload a picture again, the old ones (having the same ID) that I uploaded last session appear instead.
Ofc, my first thought was the persistence.xml and I did set it Table Generation Strategy to "none". Here is my persistence.xml (EclipseLink(JPA 2.1)):
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="OnlineTestCreatorPU" transaction-type="JTA">
<jta-data-source>jdbc/online_test_creator_db</jta-data-source>
<properties>
</properties>
</persistence-unit>
</persistence>
This didnt solve the issue either, so next I went to the glassfish-ressources.xml and removed the "create=true" Properties. This didnt solve it either.
I heard from a friend that sometimes the programm doesnt rebuild with the new settings properly and I have to make sure it cleans correctly. So I cleaned the App 10 times succesfully and Build everything again and tried but still no result. I also made sure that the DB name matched up with the entries in my persistence.xml and glassfish-ressources.xml. I am honestly at the end of my (rather limited) knowledge.
So what could be causing all my DB content to dissapear everytime I launch the App?
If anything is missing and you need further information just let me know and I'll try to provied it to the best of my ability.