----- Original Message -----
From: "Prashant Sarode" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 09, 2001 1:28 AM
Subject: [JBoss-user] Some Questions abt Session & Entity Beans
> Hi all,
> Can u pls tell me the answers to the following questions:
>
> 1. If 1000 users are accessing StateLess Session Bean, how many instances
> of it are created on the server (say Weblogic v6.1) ?
Up to the container. Why are you asking about Weblogic on a JBoss forum?
As other threads here describe, a stateless session bean is made available
(in the pool) after each method finishes. I don't know how JBoss in
particular decides if/when to create a second instance.
>
> 2. When should we use Entity Beans ? If I have to update only 1 field of 1
> table, should I use Entity Beans or not ????? Also, if there are 2/3
> tables
> to be inserted or updated, should I go for 2/3 Entity Beans or should I
> go for only StateLess Session Bean without using Entity Beans ?????
This is a design decision, and there are thousands of pages in hundreds of
books on the subject. Personally, I design everything so that a client only
ever speaks to a stateless session bean. Then the session bean can decide
if it wants to use entity beans to do work. I've opted to do all the
database work in the stateless session bean, but I can change that at any
time without affecting clients.
>
> 3. If there r multiple screens, say registration process involving 5 to 6
> screens, what should we use?
>
> a. Stateful Session Bean or
> b. Simple HttpSession Object keeping the data in the session till 6th
> screen
> & then in the last screen, insert it into the database. or
> c. Simple HttpSession Object keeping the data in the session &
inserting
> it
> in the subsequent screens into the database.
> d. Using a Stateless Session Bean
You will want to provide a mechanism for your users to go backwards and
forwards through these pages, seeing the data they've already entered,
before they finally hit "submit" on the final page. You can keep all this
data in the session if you like, but if you have a heavily used site, you'll
use up a lot of memory. We put all the data for all the pages in hidden
values on each page to avoid using session memory, then submit all the data
at the end to a stateless bean.
>
> 4. Finally, if I can do all the programming using JSP, Servlets & simple
> beans, then why should I go for EJBs ?
EJBs provide reusable components. You can get some of this value from
simple beans invoked by JSPs, but you loose some value and efficiency such
as consistent database connections via a connection pool (100 clients would
have 100 connections, whereas 100 clients talking to an EJB would use one
connection.) If you are familiar with object-oriented programming, the
concepts of encapsulatoin and reuse are important in EJB.
>
> I've seen plenty of sites of EJBs but still couldn't get the proper
> answers to the above questions. Hoping to get it from u guys.
>
> Thanks & Regards,
> Prashant
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user