Pages

Wednesday, November 30, 2011

oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key

public void lock() {


try {

super.lock();

} catch (RowInconsistentException e) {

refresh(REFRESH_WITH_DB_ONLY_IF_UNCHANGED
REFRESH_CONTAINEES);

super.lock();

}

}

What does that do? Well, it should do nothing. REFRESH_WITH_DB_ONLY_IF_UNCHANGED is a flag telling refresh() to update the row with the current value only if it’s unchanged. And REFRESH_CONTAINEES is a flag saying to refresh all composed entities, with any other flags passed down to them. So, what is it doing? It’s refreshing this entity if it’s unchanged, and then refreshing all composed entities if they’re unchanged. But an unchanged entity shouldn’t be the cause of a consistency problem, so this shouldn’t fix anything.



http://www.avromroyfaderman.com/2008/05/bring-back-the-hobgoblin-dealing-with-rowinconsistentexception/

No comments: