Almost everything is in the header ... Persistence works great when the application starts, and the row is still in the database when the application is closed, but as soon as the application loads, the rows are deleted ...
I am using an existing database structure through mysql5 SGBD.
It seems that I came from an entity manager declaration. Here are a few lines of my code, (entity manager instruction and persistence.xml)
entityManager statement:
entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory(resourceMap.getString("entityManager.persistenceUnit")).createEntityManager(); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery(resourceMap.getString("query.query"));
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="AnalysesPU" transaction-type="RESOURCE_LOCAL"> <provider>oracle.toplink.essentials.PersistenceProvider <class>solianceanalysesmanager.Produits <properties> <property name="toplink.jdbc.user" value="XXX"/> <property name="toplink.jdbc.password" value="X"/> <property name="toplink.jdbc.url" value="jdbc:mysql://localhost:3306/Analyses"/> <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/> </properties> </persistence-unit> </persistence>
Does anyone have an idea for this strange problem? I have already suggested that my entityManager reinitialize the persistence context on its approval ...
PS: Since I am French, I may have used or spoken some words incorrectly. Feel free to ask me to reformulate.
source share