Choosing between HttpSession and Stateful session bean
Servlet的HttpSession 和EJB的Stateful session 都是維持客戶端狀態, 那麼哪個最好?看看下面的優缺點:
1 . Stateful session bean
Advantages :
It supports transaction service ,security service, life cycle management, RMI, instance cache, thread safe etc. You need not write code for these services.
It can be used by both web based and non web based clients (like swing etc.) .
It can be used for multiple operations for a single http request.
Disadvantages :
Since it supports a number of services mentioned above it takes more time to process a request.
2. HttpSession object
Advantages:
It is a simple java object (perhaps a Hashtable) and takes very less time and resources to maintain a client state
Disadvantages:
It does not support the features discussed above
It cannot process multiple operations for a single http request.
So depending on your application's requirement you can choose the one best suited for you, if you want the bean only for client state management then HttpSession object gives better performance than Stateful session bean.
相關文章
- 不同jsp訪問同一個stateful session bean的困惑JSSessionBean
- 快取資料應放在HTTPSession中,還是在Session Bean?快取HTTPSessionBean
- session bean中的session如何理解?SessionBean
- session bean + dao +vo ???SessionBean
- session bean 對 entity bean的訪問策略?SessionBean
- 一個Session Bean如何去呼叫另外一個Session Bean裡的方法?SessionBean
- 一個要用stateful Session Bean 實現的登入程式,但遇到難題暫時無法解決,請老鳥們出點注意!!!SessionBean
- 什麼時候用有狀態session bean,什麼時候用無狀態session bean (轉)SessionBean
- Spring在單例bean中使用session、request範圍的beanSpring單例BeanSession
- Choosing Composite IndexesIndex
- Choosing Column Data Type
- CMP Bean在session bean後,資料怎麼返回給客戶端???BeanSession客戶端
- httpsession過期時間HTTPSession
- HttpSession工作原理簡介HTTPSession
- 如何使用bean:write輸出session中的資訊BeanSession
- spring2的session scope bean問題SpringSessionBean
- ejb 的session bean 和儲存在servlet session中的一個java物件有何不同?SessionBeanServletJava物件
- 實戰JBuilder7+WebLogic7(續Session bean) (轉)UIWebSessionBean
- 請教一個在Session Bean中使用JDBC的問題SessionBeanJDBC
- How to prove that SAP CRM WebUI is a stateful applicationWebUIAPP
- JAVAEE_Servlet_24_HttpSession實現原理JavaServletHTTPSession
- Choosing a driver model for developing a USB client driverdevclient
- 終於搞懂Spring中Scope為Request和Session的Bean了SpringSessionBean
- Tomcat6遠端呼叫GlassFish V2的session beanTomcatSessionBean
- 一個在JB9.0部署Session Bean的問題?SessionBean
- JBuilder9.0+Weblogic7.0實戰篇之Session Bean篇 (轉)UIWebSessionBean
- flink 有狀態(stateful)的計算
- Diffrence Between delete and truncatedelete
- length() between oracle and postgresqlOracleSQL
- Relationship between BAPI and RFCAPI
- JBOSS 做專案時的問題 有關Jboss, Mbean, Session bean 求助BeanSession
- Codeforces Round #246 (Div. 2) A. Choosing Teams
- 請問session bean怎麼和hibernate整和在一起啊??SessionBean
- Move users between domainsAI
- What is the difference between <%, <%=, <%# and -%> in ERB in Rails?AI
- sql語句 between-andSQL
- Transport of Tablespaces Between Databases (59)Database
- Some difference between mysql & oracleMySqlOracle