• Post Reply Bookmark Topic Watch Topic
  • New Topic

Wanted: Help understanding Session Beans

 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I'm making progress here, thanks for the help so far.
Help me understand EJB by describing what I have have to do to emulate a session bean with Java RMI (please).
I'm using Tim Halloway's list of merits for EJB. Tim: I hope you are out there.
I would have to implement an RMI server that
(1) implements remote invocation (but this is already done by RMI, CORBA or the web server),
(2) creates a thread for each client to simulate a single threaded interface?
What does a simplistic RMI application do if there are a gazillion clients all trying to access the same object -- does it serialize the clients for you so they all run on the same server thread? (I'm not sure). Do EJB implementations create a thread for each client so they all don't have to wait on each other?
What if you have a web application instead of an RMI application: then the only EJB client is the web server. Is this now a non-issue?
(2) Cache my stateless functions (how would I do that -- is not this the job of the JVM?)
(3) Implement transaction support? Would this be a non-issue for session beans? If I wanted transactions, would not I use entity beans?
(4) Implement role based security.
(5) Implement clustering.
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Siegfried,
First...
What you would be emulating if you wanted to create support for all the things you mentioned is not a bean, but a container. The application server provides containers that provides the EJB's contained in it with exactly those services. This is done so that you don't need to be an "expert" in threading, etc...
Second...
All EJB's can participate in transactions EntityBeans and SessionBeans (Stateful and Stateless). You can let the container control the transaction declaratively or you can programatically control it within the beans themselves.
I'd recommend reading the EJB Specification. It provides all kinds of interesting information that will help you better understand the roles and responsibilities of the parties involved (i.e. container provider, bean provider, etc...)
Best,
Byron Estes
 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Byron,
Can you give me a pointer to the spec?
Thanks
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Siegfried Heintze:
Byron,
Can you give me a pointer to the spec?
Thanks

Sure...
All the stuff like this is on www.javasoft.com and their search engine is pretty good...
EJB Specifications
Regards,
Byron Estes
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!