Previous Page | Next Page

  1. Introduction
  2. Learning Objectives
  3. About the Author
  4. Thank you note
  5. Component Technology
  6. Component Characteristics
  7. Component P O E
  8. Deployable Component
  9. Reusable Components
  10. Shareable Components
  11. Distributable Components
  12. SelfContained Components
  13. Standard Infrastructure Needs
  14. Application Servers
  15. Object Pooling
  16. Directory of Application Servers
  17. Container
  18. J2EE overview
  19. J2EE 1.4 APIs
  20. Enterprise JavaBeans Model
  21. EJB Overview
  22. When to use EJB
  23. Java Naming and Directory Interface
  24. EJB Specification
  25. EJB Roles
  26. EJB Design Approaches
  27. EJB Architecture
  28. EJB Flow Chart
  29. Client View of EJB
  30. EJB Client
  31. EJB Home Interface
  32. EJB Remote
  33. EJB Implementation
  34. Session Context
  35. Stateless Session EJB
  36. Stateless Session EJBs View
  37. Life Cycle of Stateless Session Bean
  38. Stateful Session EJBs View
  39. Life Cycle of Stateful Session Bean
  40. Stateful vs Stateless
  41. Entity Bean
  42. BMP Entity EJBs
  43. Primary key class
  44. Shared Entity Bean
  45. Life Cycle of BMP Entity Bean
  46. CMP Entity EJBs
  47. Life Cycle of CMP Entity Bean
  48. BMP vs CMP
  49. Message Driven Bean
  50. Message Driven EJBs
  51. Life Cycle of Message Driven Bean
  52. Deployment
  53. Other interfaces and classes
  54. Exceptions
  55. Example 1
  56. Steps to Develop an EJB
  57. Hello World Object Model using RMI
  58. Hello World Object Model using LOCAL
  59. HelloBean Home Interface
  60. HelloLocalHome Interface
  61. HelloBean Remote Interface
  62. HelloLocal Interface
  63. The Bean Class
  64. The Deployment descriptor
  65. The Client
  66. EJB Jar File
  67. EJB Application Assembler
  68. Example 2
  69. Stateful Session Remote Interface
  70. Stateful Session Home Interface
  71. Stateful Session Bean Class
  72. Stateful Session Bean Class
  73. Stateful Session Bean Class
  74. Stateful Deployment Descriptor
  75. Stateful Deployment Descriptor
  76. Stateful Deployment Descriptor
  77. Stateful Session Client
  78. Stateful Session Client
  79. Book Exception
  80. ID Verifier
  81. All Examples
  82. Component Comparison
  83. Component Comparison
  84. Component Comparison
  85. Component Comparison
  86. Component Comparison
  87. Component Comparison
  88. Component Comparison
  89. Component Comparison
  90. Component Comparison
  91. Conclusion
  92. References
  93. Finish


39. Stateful vs Stateless



Stateful Bean

A stateful bean contains a conversational state that is retained across method calls and transactions.

The create method takes arguments
e.g. create(String id) , create(int I , String id)Star
There can be one or more arguments in a create method

e.g
An EJB that unzips 100 bytes of data
An EJB that checks to see if a stock symbol is valid

Stateless Bean

A stateless bean does not have any state between calls to its methods

The create method does not take arguments
e.g create()
There can be no arguments in a create methodStar

e.g
An EJB that books a flight and rents a car at a travel agentís
web site.











Method by method comparison can be seen in EJB20Matrix.doc at http://www.volantec.biz/cmp20.htm

Copyright 2004 Kanti Prasad All rights reserved