Results 1 to 7 of 7

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

  1. #1
    Join Date
    May 2011
    Posts
    20

    Default 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. #2
    Join Date
    May 2011
    Posts
    20

    Default

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

  3. #3
    Join Date
    May 2011
    Posts
    20

    Default

    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?

  4. #4
    Join Date
    May 2011
    Posts
    20

    Default

    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?

  5. #5
    Join Date
    May 2011
    Posts
    20

    Default

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

  6. #6
    Join Date
    Dec 2005
    Posts
    929

    Default

    Change the hibernate.hbm2ddl.auto property in the persistence.xml to "update"
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  7. #7
    Join Date
    May 2011
    Posts
    20

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •