Re: ClusterJ multi thread java programming
Hi Arco,
It sounds like you have the right idea. You need a separate Session for each thread, since Session is not multi-thread safe.
Something like this should work:
success = false;
while (success || ++retries < maxRetries) {
try {
session.currentTransaction().begin();
doStuff(session);
session.currentTransaction().commit();
success = true;
} catch (Exception ex) {
log(ex);
session.currentTransaction().rollback();
}
}
What kind of errors are being reported?
Regards,
Craig
Subject
Views
Written By
Posted
2675
April 02, 2015 07:03AM
Re: ClusterJ multi thread java programming
1131
April 17, 2015 11:48AM
1055
April 17, 2015 12:25PM
1035
April 18, 2015 05:39PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.