ITPUB??ì3
ITPUB论坛 » Java企业开发 » JPA中的几个概念

新一届的微软MVP评选已经开始,欢迎各位推荐!

标题: JPA中的几个概念
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 17:56 
JPA中的几个概念

Transaction synchronization
is the process by which a persistence context is registered with a transaction so that
the persistence context may be notified when a transaction commits. The provider uses this
notification to ensure that a given persistence context is correctly flushed to the database.

Transaction association
is the act of binding a persistence context to a transaction. You can also
think of this as the active persistence context within the scope of that transaction.

Transaction propagation
is the process of sharing a persistence context between multiple container-managed
entity managers in a single transaction.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:10 
persistence context propagation is that the persistence context
propagates as the JTA transaction propagates.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:13 
Transaction association for extended persistence contexts is eager.
Likewise in the case of bean-managed
transactions; as soon as UserTransaction.begin() is invoked within a bean method, the container
intercepts the call and performs the same association.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:14 
Because a transaction-scoped entity manager will use an existing persistence context
associated with the transaction before it will create a new persistence context, it is possible to
share an extended persistence context with other transaction-scoped entity managers.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:22 
only one persistence context could be propagated with a JTA transaction.
the extended persistence context would always try to make itself the active
persistence context.
There can only be one active persistence
context for a transaction.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:23 
During the eager association of the
extended persistence context, the container will check to see if there is already an active persistence
context. If there is, it must be the same as the extended persistence context that it is
trying to associate, or an exception will be thrown.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
在线/呼叫 justforregister
SAP


精华贴数 1
个人空间 10
技术积分 41010 (18)
社区积分 11480 (136)
注册日期 2005-6-10
论坛徽章:84
      
      

发表于 2008-7-5 18:25 
呵呵, 学了不少


__________________
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:29 
While extended persistence context propagation is useful if a stateful session bean with an
extended persistence context is the first EJB to be invoked in a call chain, it limits the situations
in which other components can call into the stateful session bean if they too are using entity
managers.
One way to work around this problem is to change the default transaction attribute for the
stateful session bean that uses the extended persistence context.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:30 


QUOTE:
原帖由 justforregister 于 2008-7-5 18:25 发表
呵呵, 学了不少

要点,容易混淆和忽视的地方!直接影响设计!


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
离线 Sky-Tiger
天王盖地虎


来自 Vancouver
精华贴数 39
个人空间 0
技术积分 161064 (3)
社区积分 46988 (14)
注册日期 2004-2-19
论坛徽章:271
现任管理团队成员ITPUB长老会成员Heart of PUB管理团队2007贡献徽章管理团队2006纪念徽章会员2007贡献徽章
会员2006贡献徽章开发板块每日发贴之星开发板块每日发贴之星开发板块每日发贴之星生肖徽章2007版:猴生肖徽章2007版:猪

发表于 2008-7-5 18:32 
Note that excessive use of the
REQUIRES_NEW transaction attribute can lead to application performance problems as many more
transactions than normal will be created and active transactions will be suspended and resumed.


__________________
-----孰能浊以静之徐清  孰能安以动之徐生-----  
-----风来疏竹  风过而竹不留声;雁照寒塘  雁去而塘不留影; 故君子事来而心始现  事去而心随空----

----------------
Groovy 研究中...
JAX-WS20(finished)/CXF/ESB/BPEL 研究中...
EJB3(finished)/Hibernate3 研究中...
OSGI/KnopflerFish 研究中...
JBOSS Seam2.0/JSF/AJAX(finished)/ICEFace/ZKoss/Flex3 研究中...
Mysql 研究中...
Spring2.5  研究中...
Blog/Wiki/RSS/ATOM 研究中...
只看该作者    顶部
相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问