0
我正面臨着通過「上下文查找」從遠程客戶端調用EJB(持久實現)並且執行不同事務的問題。每次我調用有狀態容器管理的EJB時,它都會提交併在出現錯誤時不回滾。我的僞代碼:來自pojo的Java-ee遠程調用ejb事務
調用遠程EJB persist方法:
transactionController.persist(getCurrentEntity());
凡transactionController經 「上下文查找」 設置。
我的EJB:
@Remote
@Stateful(name = "TransactionController")
public class TransactionController {
@PersistenceContext
EntityManager entityManager;
public void persist(Object object){
entityManager.persist(object);
}
是否有可能從一個POJO(遠程)調用它時管理containter內交易?我該如何解決這個問題?
是的,是否支持Bean管理的事務,是否有容器管理事務的解決方案(沒有明確設置「開始」和「提交」) – pumukel
開始和提交應該在你的_remote client_中完成,如果它不是ejb。 –