Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-25196

(7.4.z) HHH-16586 - When merging a persisted entity with a null Version, Hibernate treats entity as transient instead of throwing an Exception

XMLWordPrintable

      https://hibernate.atlassian.net/browse/HHH-16586

      Observed behaviour

      • Entity has a Version field of type Long.
      • New instance gets persisted.
      • Instance is modified and merge is attempted with a null version field.
      • Hibernate does not complain about null version. Instead the entity is treated as transient, although it exists in the database, leading to unexpected results.

      Expected behaviour

      • When attempting to merge a persisted and detached entity with a null version, Hibernate either throws an exception or fetches the latest version from the database.

            lvydra Lukas Vydra
            thjenkin@redhat.com Tom Jenkinson
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: