• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Basic Ejb Question

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am new to EJB. When Iam trying to explore ,
Few basic questions are really troubling me in EJB. I would like to know whether my thinking is right .

1) For Statelss session beans , ejbCreate() will be called only once because of pooling.

2) For Statefull session beans ejbCreate() method will be called everytime as per request because we
cant pool.

3)Whether Stateless session beans can be accessed by multiple cleints.

4) Why multiple client access is not supported in Session beans, when session beans support transactions.
5)Whether the only main difference between Statefull session bean and Entity bean is the multiple client access support.

It will be thankfull to me if you people provide some light on above things with specific examples.

Thanks

Krishna
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All Enterprise Beans are pooled. What this means is when you start your server the number of instances available for a particular bean is governed by a property set in your deployment descriptor.
Since a Stateful Session Bean can hold state across multiple method calls, you can have a variety of ejbCreate() method signatures (with different argument lists).
Stateless Session Beans improve scalability, since it is associated to a client for a method call only. So by having fewer stateless session beans you can serve more clients, which you cannot do with stateful session beans as they are associated to a client as long as it stays alive.
Multiple Access is never provided to any Enterprise Bean. The state held by Stateful Session or an Entity Bean is with respect to a client.
Entity Beans model the data present in your database. Session Bean model your Business logic. If you use Container Managed Persistence, you are always assured that the data present in your database and that lying with your Entity Bean will be synchronised.
Hope this answers your doubts.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic