Questions tagged [staleobjectstate]
32 questions
1
vote
1 answer
Avoid StaleObjectStateException when deleting entity
I have 2 concurrent threads that at the same time enter a (Spring) transaction service.
Using Hibernate, the service method loads some entities, processes those, finds one and deletes it from the DB. The pseudo code is as…

Ciaccia
- 382
- 3
- 14
1
vote
1 answer
Threading - Guarantee getting the last result
I have several threads which call a method. It looks something like this:
public void DoWork(params int[] initialConditions)
{
//Do a lot of work
}
However, If conditions are changing quickly, I get a lot of stale intermediate results because I…

bwall
- 984
- 8
- 22
1
vote
1 answer
Concurrent API LayoutLocalService.addLayout throws StaleObjectStateException in LayoutSetLocalService
UPDATE
Liferay ticket accepted , solution in dev : https://issues.liferay.com/browse/LPS-82954
Situation
My context is a parallel import of liferay layouts through a liferay portlet; build with spring. When i´m executing it in Liferay dxp; the api…

André
- 172
- 13
1
vote
1 answer
Advanced Stale elements
I have been reading about stale elements and am still a bit confused. For instance, the following won't work, correct?
public void clickFoo(WebElement ele) {
try {
ele.click();
} catch (StaleElementReferenceException ex) {
…

Tony
- 1,127
- 1
- 18
- 29
1
vote
0 answers
JPA: why merge will update join table without cascade
Thanks for taking a look at this question in advance.
Basically, I have a few entities and here's the relationship.
Table A ---< Table AB >---- Table B
And the entity classes:
class A {
@ManyToMany
@JoinTable(name = "A_B",…

user2888156
- 11
- 2
1
vote
1 answer
Grails StaleObjectException with Dynamic Finder (Hibernate)
I have a batch job that consistently throws stale object exceptions on a dynamic finder. Ideally I would not be running an ORM solution for this job, but I have no choice. The exception occurs in FormulaTagService, which is being called from…

Lior
- 60
- 10
1
vote
2 answers
How to detect transaction conflicts with Hibernate?
I am using Hibernate 2.6 with hibernate-entitymanager. I am trying to catch and handle situations when 2 transactions conflict on an object. Here is what happens:
Two threads are updating a single object wich has a @Version field. The thread which…

artemb
- 9,251
- 9
- 48
- 68
1
vote
1 answer
NHibernate, why does loading an entity after delete cause stale state exception?
I have a list of Item entities that are being processed in a batch, something like this:
foreach (var itemId in ItemIdList)
{
var item = getById(itemId); //load line
if(item != null)
{
//...do some processing
delete(item)
…

getit
- 623
- 2
- 8
- 30
0
votes
1 answer
Handling Hibernate Exceptions in Spring Declarative Transaction Management
I have used PROPAGATION_REQUIRED declarative transaction management approach for my Spring+Hibernate+Struts application.
I can catch the StaleObjectException(intended) in the place where the service call is made (where the transaction starts).…

TJ-
- 14,085
- 12
- 59
- 90
0
votes
1 answer
WPF notified ComboBox selection box and drop-down list item not synchronizing and not refreshing promptly
I want combo boxes in my MVVM form to refresh both their selection box that shows the currently selected item and the drop-down list item of the currently selected item as soon as the bound data is changed. I can't get this to happen.
It is…

Moonling
- 59
- 2
- 9
0
votes
3 answers
Stale Object Reference while Navigation using Selenium
I have been trying a simple program that navigates and fetches data from the new page, comes back in history and open other page and fetch data and so on until all the links have been visited and data is fetched.
After getting results on the below…
user7195739
0
votes
2 answers
How to "heal" a hibernate session
Is it possible to heal exceptions that arise during saving/committing a hibernate session?
Background: We are currently updating several hundred records per session, using FluentNHibernate. Each now and then, there is a StaleException thrown because…

Udontknow
- 1,472
- 12
- 32
0
votes
1 answer
Can't figure out cause of StaleObjectStateException
I'm having a hard time trying to figure out the reason I keep seeing:
`HibernateOptimisticLockingFailureException: FlowExecution: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by…

Paulo Cezar
- 1
- 2
0
votes
0 answers
grails, row was updated or deleted by another transaction
I am trying to call a few services in my controllers update method. Unfortunatly this results in a StaleObjectStateException and I dont really know why since I'm "just" calling service-methods which are transactional
Here is the exception:
| Error…

Christian
- 821
- 1
- 11
- 26
0
votes
1 answer
grails ajax call row-was-updated-or-deleted-by-another-transaction-or-unsaved-value-mapping-was
I am using Grails 2.3.5 and I have a controller which contains a ajaxDelete method. This method receives the name as a String of the entity i want to delete. I am using a service to delete the entity which I call from within my controller.
The…

user3065675
- 3
- 2