Results 1 to 4 of 4

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

  1. #1

    Default 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. #2
    Join Date
    Nov 2006
    Posts
    12

    Default

    Try hibernate.hbbm2ddl.auto=update

  3. #3
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    314

    Default

    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"
    if a trainstation is where the train stops, what's a workstation...

  4. #4

    Default

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

    Cheers!

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
  •