Announcement Announcement Module
Collapse
No announcement yet.
Data is not getting committed when the transaction propogation is NEVER Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data is not getting committed when the transaction propogation is NEVER

    I have a method whose transaction propogation is set to NEVER in the class which is annotated as @Service. In the method, I am updating an entity and adding an entity using EntityManager merge and persist, but the data is not getting updated or inserted into the database and there are no exception in the log. Please advise me to resolve this issue.

  • #2
    Well you have no transaction, data modifications without a transaction is going to do nothing in the database. To change data in the database you need a transaction.

    Comment


    • #3
      Thank you for the reply.

      But, the data is getting committed when I explicity call hibernate session.flush() in the method where transaction propogation is set to NEVER. Is it a desired behavior?

      Comment


      • #4
        Flush flushes the queries to the database, if you have a MySQL table that doesn't support transactions that is the same as committing else it shouldn't persist.

        Comment

        Working...
        X