Announcement Announcement Module
No announcement yet.
Data lost after inserting the record. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data lost after inserting the record.

    Hello friends,

    We started a new project and we use Struts, Springs and Hibernate. I have a problem with inserting data in my SQL server. When i hit the save button the records get inserted (in 11 tables). But when i restart my tomcat server data inserted in 8 tables lost. i.e gets deleted. Still i didn't use transactions. We are using two techniques here.
    1. We write a common DAO implementation. For each bean we have dao interface but have only one implmentation class for all beans.
    2. We delegate action management to Springs.

    Thank you,


  • #2
    Check your Hibernate configuration, you probably have the property createSchema set (or use another setting to enable automatic creation of your database schema).


    • #3
      Thank you. In my xml file now i removed this line

      <prop key="">create</prop>

      and its working. Actually we are creating pojos from tables. ie. reverse engineering.

      Could you help me how to use transaction is this scenerio (using common dao and delegate actions to spring)

      Thanks for your help.


      • #4
        I would recommend having a read of the reference manual chapter on transactions and having a look at the samples that ship with Spring.