Announcement Announcement Module
No announcement yet.
EntityManager.persist() not inserting into DB Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • EntityManager.persist() not inserting into DB

    I'm new to spring, i have a problem inserting data into DB. I'm able to fetch the data and update the data but not able to insert new row. I see no exception/error in the logs. I have attached both logs and the spring beans xml. Pls help

    Following are more details

    Using Spring 3.1.2, Hibernate 4.1.6, MySQL as the DB

  • #2
    Are you wrapping it in a transaction? Is the transaction being committed? In my experience a JPA call that doesn't persist is usually a missing transaction. It doesn't show up as an error, it simply doesn't persist.


    • #3
      Yes the persist() is being called and i guess this will happen in just one transaction. Also i tried committing the transaction too, it dint work. Also committing transaction is not recommended when we add <tx:annotation-driven transaction-manager="transactionManager" /> in the spring xml, as all the transaction handing will be taken care by spring.

      Thanks for the try