Board index » jbuilder » What is session bean's advantage over servlet?

What is session bean's advantage over servlet?


2003-11-20 12:38:38 AM
jbuilder23
Hi all,
I am always wondering if a B/S project use
data access mechanism (Simply wrapped JDBC or using RMI)
developed by ourselves , is session bean a must?
One of our projects's server is Solaris (not clustered)
and only servlets are used in the project, but our customers
are not satisfied at performance, can EJB give us a higher
performance?
Or EJB(session bean) involves clustering?
Thanks in advance.
 
 

Re:What is session bean's advantage over servlet?

Chris wrote:
Quote
Hi all,

I am always wondering if a B/S project use
data access mechanism (Simply wrapped JDBC or using RMI)
developed by ourselves , is session bean a must?

One of our projects's server is Solaris (not clustered)
and only servlets are used in the project, but our customers
are not satisfied at performance, can EJB give us a higher
performance?

Or EJB(session bean) involves clustering?

Thanks in advance.


ROTFLMAO! Sorry, but that's a good one..."can EJB give us higher
performance?"
Seriously, though, before you go embarking on a major architectural
change, you'd better invest in a good profiling tool (OptimizeIt jumps
to mind), and figure out exactly where your performance problems reside.
Without that information, you could switch everything over to EJB's
and then discover that you still have a performance problem.
--
Regards,
Lori Olson (TeamB)
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

Re:What is session bean's advantage over servlet?

Lori M Olson (TeamB) wrote:
Quote
Chris wrote:
>Hi all,
>
>I am always wondering if a B/S project use
>data access mechanism (Simply wrapped JDBC or using RMI)
>developed by ourselves , is session bean a must?
>
>One of our projects's server is Solaris (not clustered)
>and only servlets are used in the project, but our customers
>are not satisfied at performance, can EJB give us a higher
>performance?
>
>Or EJB(session bean) involves clustering?
>
>Thanks in advance.
>
>

ROTFLMAO! Sorry, but that's a good one..."can EJB give us higher
performance?"

That one struck me as seriously funny as well Lori.. <G>.
EJBS are known as resource hogs, Chris..
What part of your servlet's performance is suffering? What types of streams
are you pushing to your servlets and are you using JSP/Servlets or some
type of Java GUI client to call the servlets?
It may not be a servlet performance problems (generally servlets are PDQ),
but rather network latency that is the problem. Lori's suggestion is a very
good one, but letting us know a little more about the application
architecture might help.
BTW, there have been many issues about Solaris and Java performance,
especially in threading mechanisms. Since we have pretty much switched to
Linux, do not know if they these problems resolved or not, but you might
want to do a search. (Yes I know, you would think other platforms would
offer less than Sun's own OS, but from what I have read and observed, tis
not the case).
 

{smallsort}

Re:What is session bean's advantage over servlet?

Of course EJB can give you better performance, it can also give you worse
performance. It basicly depends on how you use it.
The book "Bitter EJB" has a section about using servlets vs session beans.
It basicly covers some pitfalls when using EJB servers and is probably a
good read for anyone who develops enterprise applications (and no, I don't
get paid for saying this :-) )
So, the performance depends highly on how the project is designed and EJBs
can help improve performance. However EJBs are not always the right tool for
the job. First check what you actual problem is and then use an appropriate
solution.
Robert
 

Re:What is session bean's advantage over servlet?

Robert Klinkenberg wrote:
Quote
[...]
The book "Bitter EJB" has a section about using servlets vs session beans.
This is a false dichotomy. All Java-based Web applications
are essentially servlet based. Session EJBs are not a replacement
for servlets. They have no ability whatsoever to handle the
request-response loop. Their role is to act as facades
to the model tier of a complex Web application. Servlets,
even in the form of JSPs, or the core servlet of a Velocity
or Tapestry application, interact with those facades.
Nothing more, nothing less.
One cannot choose between servlets and Session EJBs; you
can only choose whether to use Session EJBs with servlets, or
to use some other kind of model facade. In very simple Web
applications, one might choose to encapsulate interaction
with the model into servlets, rather than into separate facade
components. This is not advisable because it couples the
model too tightly with the controller.
Quote
It [Bitter EJB] basicly [basically] covers some pitfalls when
using EJB servers and is probably a good read for anyone
who develops enterprise applications.
Yes, that is a good book. You can get the feeling
that it is trying very hard to convince the
reader to avoid using EJBs, almost across the
board. Unfortunately, they don't seem to cover
other solutions (OR mappers, etc.) in sufficient depth
to give the reader a sense of the trade offs. (At
least that's my impression -- I quickly read the
book several months ago, and may have forgotten
how detailed their presentations of alternatives
actually is.)
--
Paul Furbacher (TeamB)
Save time, search the archives:
www.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.