java.lang.AssertionError: select hibernate_sequence.nextval from dual expected:<1> but was:<0>

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

Samebug tips

,
Expert tip

Check your pattern declaration or check your assert declaration.

Solutions on the web

via atlassian.net by Unknown author, 1 year ago
via Hibernate JIRA by Martin Šimka, 1 year ago
select hibernate_sequence.nextval from dual expected:<1> but was:<0>
via Hibernate JIRA by Martin Šimka, 1 year ago
select hibernate_sequence.nextval from dual expected:<1> but was:<0>
via GitHub by mesutcelik
, 1 year ago
expected:<813> but was:<799>
java.lang.AssertionError: select hibernate_sequence.nextval from dual expected:<1> but was:<0>
at org.junit.Assert.fail(Assert.java:93)
at org.junit.Assert.failNotEquals(Assert.java:647)
at org.junit.Assert.assertEquals(Assert.java:128)
at org.junit.Assert.assertEquals(Assert.java:472)
at org.hibernate.test.annotations.onetoone.OneToOneTest$JoinCounter.onPrepareStatement(OneToOneTest.java:440)
at org.hibernate.internal.SessionImpl.onPrepareStatement(SessionImpl.java:522)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.(StatementPreparerImpl.java:173)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.(StatementPreparerImpl.java:93)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.buildPreparedStatementPreparationTemplate(StatementPreparerImpl.java:93)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:83)
at org.hibernate.id.enhanced.SequenceStructure$1.getNextValue(SequenceStructure.java:96)
at org.hibernate.id.enhanced.OptimizerFactory$NoopOptimizer.generate(OptimizerFactory.java:257)
at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:369)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:117)
at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:208)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:151)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:78)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:772)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:746)
at org.hibernate.test.annotations.onetoone.OneToOneTest.testPkOneToOneSelectStatementDoesNotGenerateExtraJoin(OneToOneTest.java:342)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)

Users with the same issue

2 times, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
3 times, 10 months ago
103 times, 1 year ago
123 more bugmates

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