>>> "Nevarez, Benjamin" <[EMAIL PROTECTED]> 14-May-01
10:11:38 PM >>>
>Of course, EJBs allows you to optimize the database
>transactions. You can use Entity EJBs or Session EJBs
>and leave the J2EE server/container manage the
>transactions for you or you, as developer, manage the
>transactions yourself.
How do you provide an optimization like the one in my example. AFAIK
you can't. An entity bean represents a single entity - it cannot be
used to provide different access systems. This is because the concept
of a primary key, used to provide access to the bean's data is central
to the persistence mapping.
>When you are creating objects to manage this, you
>are using 'EJBs' the hard way, without using the
>advantages of your J2EE server like scalability,
>resource pooling, etc.
I don't get those things automatically you're right.
But I can design for them. My accounts app is designed to work across
many servlet containers distributing load (it relies on session load
balancing for that). Since the objects get most of their data out of
SQL there isn't much to be distributed.
Resource pooling isn't so much of an issue if you design your app
correctly either. In my accounts app for example the objects that
represent transactions are very lightweight and don't need to be
reused to achieve high levels of performance.
I do re-use resources to an extent. A single Invoice object can
represent many different actual invoices. This is just the same as
EJB.
Note that the object load is actually less than if I used an EJB
server.
>What about if you application grow from 50 users to
>2000 users?
I've designed many apps at that level of performance without resort
to EJB. There is no special reason why EJB has to be used to achieve
high performance.
What EJB gives you is an extreemly complex environment. It can do a
lot of things for you. But that complexity comes at a performance
cost. The normal way of dealing with that is to throw money at the
server hardware. That's fine but sometimes that isn't an option.
Also, I just don't believe in spending money on hardware when I can
use my brain to achieve savings.
Nic
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html