-1

I am developing j2EE application it is web sotre I use Jboss7 , maven and wildfly my problem is that after every login database content will be deleted .. any suggestion to solve this ? this is my persistance file

<?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="PiDevECommerce-ejb">
        <jta-data-source>java:jboss/datasources/MySQLDS</jta-data-source>
        <class>ecommerce.entites.Admin</class>
        <class>ecommerce.entites.Brand</class>
        <class>ecommerce.entites.Category</class>
        <class>ecommerce.entites.Coupon</class>
        <class>ecommerce.entites.Customer</class>
        <class>ecommerce.entites.Event</class>
        <class>ecommerce.entites.Offre</class>
        <class>ecommerce.entites.Product</class>
        <class>ecommerce.entites.Publication</class>
        <class>ecommerce.entites.ReclamationCoupon</class>
        <class>ecommerce.entites.ReclamationOffre</class>
        <class>ecommerce.entites.Review</class>
        <class>ecommerce.entites.Store</class>
        <class>ecommerce.entites.Storemanager</class>
        <class>ecommerce.entites.Transaction</class>
        <class>ecommerce.entites.TransactionPK</class>
        <class>ecommerce.entites.User</class>
        <properties>
            <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
        </properties>
    </persistence-unit>
</persistence>
nicha
  • 51
  • 5

1 Answers1

1

The problem is in your configuration

<properties>
        <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
    </properties>

The correct value would be validate

This post answer your question completely Click here

Community
  • 1
  • 1
Vahid Vakily
  • 306
  • 1
  • 7