Forums Register Login

Wanted: Help understanding Session Beans

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Byron,
Can you give me a pointer to the spec?
Thanks
+Pie Number of slices to send: Send
 

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
grapes are vegan food pellets. Eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 682 times.
Similar Threads
Session state management
Session beans and configuration properties
https and session state
question for author Aaron Mudler
Reasons to use plain RMI vs EJB
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:19:11.