Question about xa and transaction on ejbs

白昼怎懂夜的黑 提交于 2021-01-29 10:29:54

问题


I have two question/doubt:

  1. If two ejbs are deployed in different ear or different applicationserver, and one call the other, they still required XA indipendent that each one use one or more db as ?

  2. if two ejbs are deployed in different server, both are annotated with trans type = required,and when teh first ejb call the second, a new transaction start or use the propagation of first ejb?

**My ejbs are deployed on Webpshere, Jboss, WebLogic and can be written with JEE 5/6/7 technology(EJB 2/3).

Thanks

Roberto


回答1:


Regardless of how the EJBs are packaged (same or different EAR) or where they are deployed (same or different server), if the transaction type is Required (i.e. the default) then the transaction initiated by the first bean must flow to the second bean, or the call to the second bean must result in an error.

The server vendor should make no difference, as the behavior is defined in the Transactions chapter of the EJB specification. However, if the call is between vendors, then it may be more likely that transaction context propagation is not supported, in which case the call to the second bean should be rejected with an exception.

Basically, if the client (1st bean) is running in a transaction and calls to a second bean with "Required", then the transaction context must propagate to the second bean or result in an error.



来源:https://stackoverflow.com/questions/65749814/question-about-xa-and-transaction-on-ejbs

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