-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to handle org.hibernate.StaleStateException?
PostPosted: Wed Nov 16, 2016 1:24 am 
Newbie

Joined: Tue Nov 08, 2016 1:54 am
Posts: 14
I use REST APIs which talk to database.

Using Hibernate with Wildfly 10.1.0

When I do concurrent update I get following exception[1];

What is the proper solution for this? Should I send any error code to the client or should I handle at the backend?

[1]
Quote:
Caused by: 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)


Top
 Profile  
 
 Post subject: Re: How to handle org.hibernate.StaleStateException?
PostPosted: Wed Nov 16, 2016 7:04 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Check out this article:

How to prevent OptimisticLockException with Hibernate versionless optimistic locking


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.