Announcement Announcement Module
Collapse
No announcement yet.
Why my DB will be cleaned up everytime I restart the Web App Server? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why my DB will be cleaned up everytime I restart the Web App Server?

    My DB is MySQL, everytime I run
    Code:
    mvn jetty:run
    , And the DB will be cleaned up, all data are gone.

    Who could please tell me how to setup to avoid it?

  • #2
    I think they are deleted because of the auto generated unit tests.

    Comment


    • #3
      I am wrong, not because of the Unit Tests. The data are cleaned even I run as
      Code:
      mvn jetty:run -DskipTests=true
      Who can tell me how to avoid the data are cleaned?

      Comment


      • #4
        Oh my God, even I deployed war file to the Tomcat instance, the DB will be cleaned up everytime I start the server. What's wrong?

        Comment


        • #5
          OK, I checked. This only happens if the provider is HIBERNATE, is that a bug?

          Comment


          • #6
            Change the hibernate.hbm2ddl.auto property in the persistence.xml to "update"

            Comment


            • #7
              Thank you very much! I am not familiar with Hibernate, it is my retribution. LOL

              Comment

              Working...
              X