org.hibernate.HibernateException: The database returned no natively generated identity value

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Hibernate JIRA by Anthony Patricio, 1 year ago
The database returned no natively generated identity value
via Hibernate JIRA by Anthony Patricio, 1 year ago
The database returned no natively generated identity value
org.hibernate.HibernateException: The database returned no natively generated identity value
at org.hibernate.persister.BasicEntityPersister.getGeneratedIdentity(BasicEntityPersister.java:2020)
at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersister.java:1558)
at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersister.java:1955)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:30)
at org.hibernate.event.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:221)
at org.hibernate.event.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:148)
at org.hibernate.event.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:94)
at org.hibernate.event.DefaultCreateEventListener.entityIsTransient(DefaultCreateEventListener.java:105)
at org.hibernate.event.DefaultCreateEventListener.onCreate(DefaultCreateEventListener.java:65)
at org.hibernate.event.DefaultCreateEventListener.onCreate(DefaultCreateEventListener.java:33)
at org.hibernate.impl.SessionImpl.create(SessionImpl.java:678)
at org.hibernate.impl.SessionImpl.create(SessionImpl.java:682)
at com.eyrolles.sportTracker.test.TestH3Inheritance.testMakePersistant(TestH3Inheritance.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at com.eyrolles.sportTracker.test.TestCase.runTest(TestCase.java:18)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.