作用域为每个调用的持久化上下文。
持久化上下文的类型:事务性或扩展型。
流作用域的持久化上下文。
持久化上下文作用域划定到数据库事务。
然后提交事务,取消绑定持久化上下文并关闭它。
It will then commit the transaction, unbind the persistence context, and close it.
不使用流作用域持久化上下文的持久化编程。
Persistence programming without the flow-scoped persistence context.
在用流作用域的持久化上下文编程时必须使用此默认设置。
You have to use this default setting when programming with a flow-scoped persistence context.
当调用该操作方法时,必须重新使已更新的对象与持久化上下文建立联系。
When the action method is invoked, it is necessary to reattach the updated object to the persistence context, making the changes permanent.
在这种情况下,流作用域持久化上下文的FlushMode将一直是AUTO。
In this case, the FlushMode of the flow-scoped persistence context will always be AUTO.
注意在其中的某些用例中我们仍然能够使用流作用域的持久化上下文对象。
Note that in some of these use cases we are still able to use the flow-scoped persistence-context object.
显然流作用域持久化上下文使原子和非原子we b流中的持久化编程更顺利、更简单。
It's clear that the flow-scoped persistence context makes persistence programming in both atomic and non-atomic Web flows smoother and simpler.
因为应用程序使用无状态的服务接口,所以此时的课程实例看作已经与持久化上下文 “分离”。
Because the application uses a stateless service interface, the course instance is at this point considered "detatched" from the persistence context.
一个持久化上下文管理的booking实体,从另一个持久化上下文的角度来看,是分离的。
The booking entities managed by one persistence context are detached from the perspective of the other.
不使用流作用域持久化上下文对象的web流中的持久化编程也是可行的,只是有很多障碍和缺陷。
Programming persistence in Web flows without the flow-scoped persistence context object is still feasible but incurs many hurdles and pitfalls.
流作用域的持久化上下文对象将流期间加载的数据作为持久化实体来管理并将数据变更缓存为实体的脏状态。
The flow-scoped persistence-context object manages data loaded during the flow as persistent entities, and data changes cached as the entities' dirty states.
OpenSessioninView模式的一个缺点是持久化上下文对象被高效地划定到用户请求作用域内。
A downside of the Open Session in View pattern is that the persistence-context object is effectively scoped to a user request.
这种方法最明显的影响在原子we b流上,一旦省略了流作用域持久化上下文对象您就无法得到原子we b流了。
The most obvious impact of that approach is on atomic Web flows, which are no longer achievable once you've omitted the flow-scoped persistence-context object.
当openSessioninView模式作为过滤器或拦截器实现时,持久化上下文对象在视图呈现期间会保持打开状态。
When open Session in view is implemented as a filter or interceptor, the persistence-context object remains open during view rendering.
readOnly:通过指定 @Transactional(readOnly=false)建立读/写事务,这样会使持久化上下文的FlushMode 变为AUTO。
readOnly: Setting up a read/write transaction by specifying @Transactional(readOnly=false) will make the FlushMode of the persistence context AUTO.
@PersistenceContext注释有一个可选的属性type,该属性默认为 PersistenceContextType.TRANSACTION(也就是绑定到事务的持久化上下文)。
The @PersistenceContext annotation has an optional attribute type, which defaults to PersistenceContextType.TRANSACTION (that is, a transaction-bound persistence context).
此功能包还包括对Blueprint的扩展,所以容器可以将持久化单元和上下文注入到Blueprintbean中。
The feature pack also includes extensions to Blueprint so that the container can inject persistence units and contexts into Blueprint beans.
在整个流过程中都重用同一个持久化-上下文对象,这避免了分离实体状态的问题和相应的LazyInitializationException 异常。
The same persistence-context object is reused during the course of the entire flow, eliminating detached-entity state and the corresponding LazyInitializationException.
至于上下文数据,应该被持久化到步骤表(steps table),在其失败时可用于BusinessEvents节点。
In the case of contextual data, this data should be persisted to the steps table and be available to the new Business Events node when it fails over.
随着你应用流程的扩展,你可能会发现找不到一个合理的方式去避免在请求间,在页面活化上下文之外持久化某些数据。
As your application's workflow expands, you may find that there is not a reasonable way to avoid storing some data persistently between requests, outside of the page activation context.
随着你应用流程的扩展,你可能会发现找不到一个合理的方式去避免在请求间,在页面活化上下文之外持久化某些数据。
As your application's workflow expands, you may find that there is not a reasonable way to avoid storing some data persistently between requests, outside of the page activation context.
应用推荐