Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-871

save() and findByxxx() in same transaction gives constraint violation exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.2.0
    • None
    • Data-Module
    • None
    • Windows-7, Java-8, Netbeans-8.0.2

    Description

      It seems like when in the same EJB transaction, save() and findByxxx() is called, then delta-spike inserts the entity twice [once in save() and other time in findByxxx()] and gives a constraint violation exception.

      After some debuggin, it seems like save() gives a "INSERT" query in DB and findByxxx() method calls a flush which again gives the same "INSERT" query in DB [INSERT query from save() is not removed from EntityManager] and gives constraint violation exception.

      Attachments

        Activity

          People

            danielsoro Daniel Cunha
            mdkamaruzzaman Md Kamaruzzaman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: