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

(7.2.z) HHH-13607 Exception thrown while flushing uninitialized enhanced proxy with immutable natural ID

XMLWordPrintable

      When an uninitialized, enhanced proxy that has an immutable natural ID is flushed, the following exception is thrown:

      javax.persistence.PersistenceException: org.hibernate.HibernateException: An immutable natural identifier of entity org.hibernate.test.bytecode.enhancement.lazy.proxy.NaturalIdInUninitializedProxyTest$EntityImmutableNaturalId was altered from name to null
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
      	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1489)
      	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:512)
      	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3321)
      	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2517)
      	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:447)
      	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:178)
      	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access(JdbcResourceLocalTransactionCoordinatorImpl.java:39)
      	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:271)
      	at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:104)
      	at org.hibernate.testing.transaction.TransactionUtil2.inTransaction(TransactionUtil2.java:113)
      	at org.hibernate.testing.transaction.TransactionUtil2.lambda$inTransaction(TransactionUtil2.java:61)
      	at org.hibernate.testing.transaction.TransactionUtil2.inSession(TransactionUtil2.java:35)
      	at org.hibernate.testing.transaction.TransactionUtil2.inTransaction(TransactionUtil2.java:59)
      	at org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase.inTransaction(BaseNonConfigCoreFunctionalTestCase.java:572)
      	at org.hibernate.test.bytecode.enhancement.lazy.proxy.NaturalIdInUninitializedProxyTest.testImmutableNaturalId(NaturalIdInUninitializedProxyTest.java:43)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
      	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.hibernate.HibernateException: An immutable natural identifier of entity org.hibernate.test.bytecode.enhancement.lazy.proxy.NaturalIdInUninitializedProxyTest$EntityImmutableNaturalId was altered from name to null
      	at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkNaturalId(DefaultFlushEntityEventListener.java:114)
      	at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:191)
      	at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:146)
      	at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:235)
      	at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:94)
      	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)
      	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1483)
      	... 29 more
      

              gbadner@redhat.com Gail Badner (Inactive)
              mstefank Martin Stefanko
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: