org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

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

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via GitHub by lefevre00
, 1 year ago
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
via Stack Overflow by Arun
, 1 year ago
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
via Stack Overflow by user3686372
, 1 year ago
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
via Stack Overflow by Abhilash
, 2 months ago
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
via Stack Overflow by micdcar
, 3 months ago
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 16:46:14,478 INFO AbstractBatchImpl:208 - HHH000010: On release of batch it still contained JDBC statements
via Stack Overflow by smilin_stan
, 1 year ago
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:67)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:54)
at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:46)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3106)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2985)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3365)
at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:145)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:560)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:434)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:468)
at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3135)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2352)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:147)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)
at org.friends.app.dao.SessionDao.deleteExpired(SessionDao.java:30)
at org.friends.app.service.impl.UserServiceBean.cleanExpiredSession(UserServiceBean.java:83)
at org.friends.app.service.impl.UserServiceBean.createSession(UserServiceBean.java:78)
at org.friends.app.view.RoutesLoader.lambda$init$7(RoutesLoader.java:185)
at spark.FilterImpl$1.handle(FilterImpl.java:59)
at spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:123)
at spark.webserver.JettyHandler.doHandle(JettyHandler.java:61)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
at org.eclipse.jetty.server.Server.handle(Server.java:517)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:302)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 6 months ago
Once, 9 months ago
239 times, 3 weeks ago

Write tip

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