This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Stateless Session Beans for Scalability Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Stateless Session Beans for Scalability" Watch "Stateless Session Beans for Scalability" New topic
Author

Stateless Session Beans for Scalability

Paul Croarkin
Ranch Hand

Joined: Sep 30, 2004
Posts: 106
I have an application that is a fairly straightforward Struts project where the Action classes call some business methods on plain old java objects (POJOs), stuff the results into the request, and forward to JSPs for display.

We are expecting a significant increase in traffic after our next release. The POJOs are short-lived, but we could conceivably reach the point where we run out of memory.

My thought is to either turn the POJOs into Stateless Session Beans or have Stateless Session Beans control access to the POJOs. We could then tune performance by adjusting the pool size of the Stateless Session Beans. In essence, the Stateless Session Beans would act as a throttle when we reach a certain level of traffic.

The application has no need for other kinds of EJBs.

We are already using a full J2EE app server for this app, so cost is not an issue.

Any comments / suggestions?

Also, are there any standard metrics for determing pool sizes?

thanks!
[ May 19, 2005: Message edited by: Paul Croarkin ]

Thanks,<br /> <br />Paul Croarkin<br />SCEA 5, SCWCD, SCJP
vu lee
Ranch Hand

Joined: Apr 19, 2005
Posts: 189
...have Stateless Session Beans control access to the POJOs.

This won't solve your problem since you may still end up having many POJOs.

Replacing POJOs by stateless session bean seems to be a viable solution since you take advantages of the container to control/reuse resources.
sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
Hi,

###################################################################
I have an application that is a fairly straightforward Struts project where the Action classes call some business methods on plain old java objects (POJOs), stuff the results into the request, and forward to JSPs for display

###################################################################

The approach that you are using currently will have a good response time. I don't know that in your java classes are you making a hit to the database or not and if yes then how you are controlling the transactions.

Also after a flow is over you can null the references of the POJO so that they will be garbage collected.

By implementing the session bean you can make use of the transaction support of the container but as far the memory is concerned implementing session beans won't do much help.

sawan


Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stateless Session Beans for Scalability
 
Similar Threads
which pattern does this fall under
Session Bean (Stateless bean) problem
how do I configure size of stateless bean pool ?
Why does Stateless Session Beans need pooling?
EJBs and Pojos Concurrency Problem