Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3980178
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:15:35+00:00 2026-05-20T05:15:35+00:00

Almost all is in the title… Persistence is working fine when app launched, and

  • 0

Almost all is in the title… Persistence is working fine when app launched, and row are still in DB when the app is closed, but once app is loaded, rows got deleted…

I’m using an already existing database structure, through the mysql5 SGBD.

Seems to be coming from my entity manager declaration. Here are a few lines of my code, (entity manager statement, 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 someone have an idea of this strange problem cause?
I already got suggested that my entityManager was reinitialising persistence context on its statement…

PS: Since i’m french, it’s possible i mis-used or mis-spelled some words. Feel free to ask me to reformulate.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:15:35+00:00Added an answer on May 20, 2026 at 5:15 am

    TopLink Essentials does not recreate your tables by default, but this can be configured in your persistence.xml.

    See,
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/DDL

    My guess is you are using Glassfish? I believe Glassfish does this by default in development mode, and there is some Glassfish setting you need to configure to avoid this. I’m not sure how this is configured in Glassfish though, perhaps someone else does.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I guess the title almost says it all. My original url looks like: http://www.something.com/buy/index.php?p=025823
The title say's almost all. What I have is short lived server processes that
My post title almost states it all: How do I download a file from
In almost all projects, the choice of the database system is 'almost' automatic ..
In the STL almost all containers have an erase function. The question I have
I know that you can run almost all Java in Dalvik's VM that you
I think, in almost all cases user preference data may be stored in a
Like many SO people, I'm in front of a computer almost all day. I
I want to make a multi-language site, such that all or almost all pages
I use a lot of ObjectDataSources (ods) in my website projects. Almost all of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.