Results 1 to 3 of 3

Thread: Tables re-created each times!

  1. #1

    Question Tables re-created each times!



    this is my persistence layer: persistence setup --provider HIBERNATE --database POSTGRES --userName postgres --password postgres --databaseName roo

    all works fine... but when I kill tomcat with ctrl+c and run it again, it recreates tables on db.... empty!!
    why?

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    If you are using Hibernate you can set:

    Code:
    <property name="hibernate.hbm2ddl.auto" value="update"/>
    in persistence.xml to keep your data.

    Just be aware that changes to your domain model (and therefore table model) will possibly cause some issues there. But as long as your domain model is fairly stable you should be good with the 'update' flag.
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3

    Default

    Perfect. This is resolved.

Posting Permissions

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