pb00067 wrote:
Quote:
there is retry logic that refreshes the session, and reloads the data.
Can you please post the code of this your retry logic.
Do you also use Cascade on persist option?
Apologize for not posting it earlier. Didn't want to spam with code.
The gist of the retry logic is as follows-
boolean success = false;
while (!success) {
try {
processOlapQuery(idIterator, outputFileHandler, helper, operationHandler);
success = true;
} catch (StaleObjectStateException e) {
//first we'll restart session
DAOSessionHelper.endSession();
DAOSessionHelper.startSession();
//then reset input, output, and helper/handler
idIterator.reset();
outputFileHandler.reset();
helper.reset();
operationHandler.refresh();
//check this AFTER we reset everything, so session is in a usable state
if (staleStateCount > MAX_STALE_STATE_RETRIES) {
logger.error("Un-recoverable error (too many stalestates!): " + e.getMessage(), e);
throw e;
}
staleStateCount++;
}
}
And yes the map property of the child in the parent config file has the cascade as
cascade="all,delete-orphan"