Announcement Announcement Module
Collapse
No announcement yet.
mvn jetty:run <- deleting database contents!! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • mvn jetty:run <- deleting database contents!!

    Hello guys!

    I have prepared multilevel project using Maven2 for the webapp I want to create. So, I have:

    sf/sf-core -> which is my CORE project, responsible for business model and data layers
    sf/sf-webapp -> which is my webapp

    Now, I have configured Hibernate3 in my CORE project, and SpringMVC in my WEBAPP. I have also used DbUnit for populating my database (MYSQL) with sample data.

    So if I run:

    CORE_DIR: mvn dbunit: operation <- this puts my sample data into DataBAse (checked few times)

    The strange thing happens if I want to run my WEBAPP in Jetty container...
    after:

    WEBAPP_DIR: mvn jetty:run <- my DataBase is suddenly empty!

    It looks like running jetty causes my database to drop the content. I assume this is somehow related to running MVC's HIbernate Session Factory components, but I have no idea what is wrong there. I have checked all configuration files in my project, and couldn't come up with anything...

    Do You have any ideas what might be the problem?

    Best regards!
    Bat

  • #2
    Try hibernate.hbbm2ddl.auto=update

    Comment


    • #3
      Make sure you don't have any "drop" setting in DbUnit configuration which drops the database after execution.

      Does the database content exist after the you have run the dbunit?

      Check the hibernateProperties.

      There's a typo in the previous answer. The setting should be "hibernate.hbm2ddl.auto=update"

      Comment


      • #4
        You guys were right. Setting
        hibernate.hbbm2ddl.auto=update
        property solved my problem.

        Cheers!

        Comment

        Working...
        X