Again, you should always explore other options such as the use of a stateless session bean with a transaction layer.
再次强调,您应当始终探索其它选项,如使用带有事务层的无状态会话bean。
Reset request – the transaction layer must discard all pending transactions and stop accepting link or application layer requests.
重置请求-事务处理层必须丢弃所有未决处理并停止接受连接和应用层请求。
Initialize request - the transaction layer must discard all pending transactions and start accepting link or application layer requests.
初始化请求-事务处理层必须丢弃所有未决处理并开始接受连接和应用层请求。
If a stateful solution is essential, consider using stateless session beans with a simple transaction layer, or creating a thin servlet layer on top of the business tier.
如果有状态解决方案是必需的,则请考虑使用带有简单事务层的无状态会话bean,或者在业务层上创建瘦servlet层。
The platform is divided into five layers named as locate equipment layer, data collect and check layer, data transaction layer, data transport layer and application layer.
平台为五层结构,分别为现场设备层、数据采集与校验层、数据处理层、数据传输层以及应用层。
Only methods in the client layer and the API layer of the application architecture should contain transaction logic.
只有应用程序体系结构的客户端层和api层中的方法才应该包含事务逻辑。
The API Layer and Client Orchestration transaction strategies that I've covered in previous articles in this series are core strategies that apply to most standard business applications.
我在本系列的前几篇文章中所介绍的api层和客户端编排策略事务策略是应用于大多数标准业务应用程序的核心策略。
To illustrate the read-first technique, I'll start with some code that implements the API Layer transaction strategy.
为了演示这种先读取技巧,我们从一些实现api层事务策略的代码入手。
Callers will have varying transactional requirements, so the service layer should allow the caller to affect transaction handling.
调用者将会具有不同的事务需求,因此服务层应该允许调用者影响事务处理。
Transaction demarcation can have a negative effect on service layer reusability if implemented inappropriately.
如果实现方式不当,事务划分会对服务层可重用性产生负面影响。
You can configure your service layer to use different transaction managers depending on the capabilities of the target environment.
可以对服务层进行配置,以根据目标环境的功能使用不同的事务管理器。
The client layer controls the transaction scope.
客户端层控制事务作用域。
Only the public methods included in the application architecture's API layer contain transaction logic.
只有包含在应用程序架构的api层中的公共方法包含事务逻辑。
The transaction from the API layer will propagate to all methods invoked under the transaction owner (as defined in the next section).
API层的事务将传播到在事务所有者内调用的所有方法(如下一小节定义的那样)。
As with the other transaction strategies, regardless of the component or layer you choose to start the transaction, the method that starts the transaction is considered the transaction owner.
与其他事务策略一样,无论您选择开始事务的组件或层是什么,启动事务的方法都被认为是事务拥有者。
Because you cannot programmatically pass a transaction context, the API layer must use the declarative transaction model, meaning that the container manages the transaction.
由于您不能通过编程传递事务上下文,因此 API层必须使用声明式事务模型,这表示容器将管理事务。
This causes the transaction to complete (commit or roll back) faster than in the API Layer transaction strategy.
其结果是,事务会比在api层事务策略中更快地完成(提交或回滚)。
Remember the golden rules: the client method invoking the API layer method is the transaction owner, and only the transaction owner should be responsible for rollback.
记住刚才的两条黄金法则:调用api层方法的客户机方法是事务所有者,只有事务所有者才负责执行回滚。
The transaction context from the client layer will propagate to the API layer methods and all methods invoked under the API layer.
客户端层中的事务上下文将传播给API 层方法以及在 API 层中调用的所有方法。
Because the only layer containing transaction logic is the API layer, I will only show the transaction logic in that layer's domain-model classes.
因为包含事务逻辑的惟一的一个层是api层,我将只展示该层的域模型类中的事务逻辑。
This transaction strategy is well-suited for applications that have a coarse-grained API layer.
这个事务策略非常适合拥有粗粒度api层的应用程序。
Notice in this strategy that both the client layer and the API layer contain transaction logic.
注意,在此策略中,客户端层和api层包含事务逻辑。
The entity management layer is responsible for entity management and ensuring the transaction integrity of that object within the container.
实体管理层负责实体管理,并确保容器内该对象的事务完整性。
Furthermore, using REQUIRED in the API layer methods means that a transaction could be started by the API layer, thereby violating the main principles of the Client Orchestration transaction strategy.
此外,在api层方法中使用REQUIRED意味着事务可以由api层开始,因此这违反了客户端编排事务策略的主要原则。
All public read methods in the API layer by default should be marked with a transaction attribute of SUPPORTS.
api层中的所有公共读方法默认都应该标记一个SUPPORTS事务属性。
As I said earlier, one of the biggest restrictions with this transaction strategy is that the client layer must be able to start a transaction and propagate it to the API layer.
如前所述,这种事务策略的最大一个限制就是,客户端层必须能够开始一个事务并将它传播给api层。
The integration layer ACTS as an intermediary service for the data transaction.
集成层充当数据事务的中间层服务。
Back to the original point: with the API layer transaction strategy, the client must not make multiple calls to the API layer in a single unit of work requiring a transaction.
回到原点:对于api层事务策略,客户机绝对不能在涉及事务的单一工作单元中对api层发出多个调用。
With the API layer transaction strategy, it's not the end of the world if you start a transaction at the client layer during a refactoring effort.
对于api层事务策略,您在重构过程中在客户端层上开始一个事务并不会引起灾难性后果。
Although the API Layer transaction strategy is the most common strategy, it may not be the right one for your application.
尽管APILayer事务策略是最常见的一种策略,但它也许正是您的应用程序所需要的策略。
应用推荐