0
搞得我有一些線程下執行如下代碼,到目前爲止,我可以使它在如何等待合併到一份堅持在JPA
entityManager = DatabaseCommon.getEntityManager();
entityManager.getTransaction().begin();
entityManager.persist(smsReceived);
entityManager.getTransaction().commit();
sendedMo = sendMo(); //that method consumes a WS.
if (sendedMo) {
smsReceived.setSmsStatus("0");
}
entityManager.getTransaction().begin();
entityManager.merge(smsReceived);
entityManager.getTransaction().commit();
這是當然的一個嘗試catch塊堅持,所以,問題是:如何等待合併,直到持續存在?
THX :)