关于XA和ejbs上的交易的问题 [英] Question about xa and transaction on ejbs

查看:78
本文介绍了关于XA和ejbs上的交易的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题/疑问:

  1. 如果将两个ejb部署在不同的耳朵或不同的应用服务器中,并且一个调用另一个,则它们仍然需要XA独立性,即每个ejb都使用一个或多个db作为?

  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 ?

如果两个ejb部署在不同的服务器上,都用trans type = required注释,并且当第一个ejb调用第二个ejb时,新事务开始或使用第一个ejb的传播?

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?

**我的ejbs部署在Webpshere,Jboss,WebLogic上,并且可以使用JEE 5/6/7技术(EJB 2/3)编写.

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

谢谢

罗伯托

推荐答案

如果事务类型为Required,则无论EJB的打包方式(相同或不同的EAR)还是它们的部署位置(相同或不同的服务器) (即默认值),则第一个bean发起的事务必须流到第二个bean,或者对第二个bean的调用必须导致错误.

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.

服务器供应商应该没有任何区别,因为行为在EJB规范的交易"一章中定义.但是,如果调用是在供应商之间进行的,则很可能不支持事务上下文传播,在这种情况下,应拒绝对第二个bean的调用,但有例外.

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.

基本上,如果客户端(第一个bean)正在事务中运行并以"Required"调用第二个bean,则事务上下文必须传播到第二个bean或导致错误.

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.

这篇关于关于XA和ejbs上的交易的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆