Topic: 关于 Fast-Lane Reader 模式 |
Print this page |
1.关于 Fast-Lane Reader 模式 | Copy to clipboard |
Posted by: jameszhang Posted on: 2004-10-23 10:39 最进又看 刘兵(bliu76@yeah.net)<PetStore 中EJB 的设计模式> 对于Fast-Lane Reader 模式,不解,拿出来跟大家讨论一下: 原文 Fast-Lane Reader 模式:Accelerate read-only data access by not using enterprise beans. 但是如果用 ENTITY BEAN 来负责一些只读的 应该不会慢,不解? |
2.Re:关于 Fast-Lane Reader 模式 [Re: jameszhang] | Copy to clipboard |
Posted by: tongang Posted on: 2004-10-26 23:59 ENTITY BEAN,查询大量的数据就会变慢的。 Fast-Lane Reader 模式根据DAO直接读取数据库。然后通过缓存。。用SESSION BEAN的方式发布。速度就快很多了。。 他是指大数据查询的时候使用的。技术。。 |
3.Re:关于 Fast-Lane Reader 模式 [Re: jameszhang] | Copy to clipboard |
Posted by: tongang Posted on: 2004-10-26 23:59 ENTITY BEAN,查询大量的数据就会变慢的。 Fast-Lane Reader 模式根据DAO直接读取数据库。然后通过缓存。。用SESSION BEAN的方式发布。速度就快很多了。。 他是指大数据查询的时候使用的。 |
4.Re:关于 Fast-Lane Reader 模式 [Re: jameszhang] | Copy to clipboard |
Posted by: jameszhang Posted on: 2004-10-27 11:10 看文中意思,好象不是!?我有只读数据用实体BEAN 是否快呢? |
5.Re:关于 Fast-Lane Reader 模式 [Re: jameszhang] | Copy to clipboard |
Posted by: emarket Posted on: 2004-10-27 13:09 Core J2EE Pattern 2nd p56里面有所提及,CMP 被 force CMT, 而 Transaction 对 read only data 简直就是浪费,Using an entity bean as a read-only object simply wastes expensive resources and result in unnecessary update transactions to persistent store. this is due to the invocation of ejbStore() methods by the container during teh entity bean's life cycle. Since the container has no way of knowing if the data was changed during a method invocation, it must assume that it has and invoke the ejbStore. Thus, the container make no distinction between read-only and read-write entity beans. 虽然某些container 提供 read-only entity beans, 当时J2EE spec 没有定义,所以这些属于私有实现。 jameszhang wrote: |
6.Re:关于 Fast-Lane Reader 模式 [Re: tongang] | Copy to clipboard |
Posted by: emarket Posted on: 2004-10-27 13:11 好像不是这样的吧,entity bean也可以缓存的哦。真正的原因不是大量,而是transaction tongang wrote: |
7.Re:关于 Fast-Lane Reader 模式 [Re: jameszhang] | Copy to clipboard |
Posted by: jameszhang Posted on: 2004-10-27 13:39 我在应用中,就是使用read-only ejbLoad 一次数据,然后疯狂调用,效果不错,页面流畅,在800用户同时在线的情况下响应时间平均只有几秒中(服务器512MB,WLS只用了 256MB) |
8.Re:关于 Fast-Lane Reader 模式 [Re: jameszhang] | Copy to clipboard |
Posted by: emarket Posted on: 2004-10-31 12:41 jameszhang wrote: 如果你的read only entity bean(不要用container私有的办法设置entity bean为 read only)参与了transaction , 好像不会只调用一次 ejbLoad吧。 另外 ejbStore 也会被调用的哦。 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |