Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changes in the DB disappear

 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am facing strange issue.

I am doing the examples of EJB ( o'reilly ) book.

I have configured the persistance.xml file to use the oracle database.

As soon as I stop the server or undeploy the ejb.jar file the changes in the database are gone as well as the table itself.

Please advise.
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun Kumar,

The answer is at page 558-559:

The <properties> element is used to configure JBoss-specific properties.
The only property set here is the hibernate.hbm2ddl.auto property, which is used to autogenerate database schemas. The two interesting values for this property are create-drop and update.

The create-drop value creates a table for each entity bean class deployed based on the mapping declared in that bean class and any mapping file. The tables are created when the persistence unit is deployed on the application server. The tables are dropped and removed from the database when the persistence unit is undeployed or redeployed on the application server. This value is very useful for tutorials!
 
Arun Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nail on the Head.

Thanks Beno�t.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic