This is the piece of code from my program,in which I have tried to insert into Question table with hibernate saveOrUpdae()
method.
this.txTemplate.setReadOnly(false);
this.txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
this.txTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status)
{
questionManager.saveQuestionsofCurrentUser(filteredStreamDataMapForCurrentUSer.values(),user);
questionManager.updateQuestionsReady1on2(user);
}
});
When try to run with multiple users, I am getting org.hibernate.NonUniqueObjectException:
.The process run using multi thread concept.Any one can suggest a solution for it?