TransactionAttribute.REQUIRES_NEW in JPA

北慕城南 提交于 2019-12-04 17:54:31

I guess that you're not invoking a business method at all. You're invoking local call (implicit 'this') - not the EJB one.

Try doing this call by using a business interface.

Try changing the calls to test1() and test2() in your test() class from:

test1(config);
test2(config);

to

getBusinessObject(YourEJB.class).test1(config);
getBusinessObject(YourEJB.class).test2(config);

PS. I'm not sure about that, but the container can use proxy object for EntityManager, so try testing if you're really in the same PersistenceContext (by doing some operations rather than just calling it's reference)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!