Your way would work as well, in a sense that you would mix two classes
(DBLayer and your servlet) into one class. I would suggest however, to
follow the first suggestion as to create a new db layer ( you can look into
javaexchange.com; or connection pool class (jdbc 2.0) to handle this thing
=)... and initiliaze it in your servlet init()

then you can use it for the rest of your servlet life =)

regards,

harry




----- Original Message -----
From: "Anoop Maheshwari" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 02, 2000 5:41 PM
Subject: Re: A scalable architecture using Java Servlets


> Hi Sushil
>
> Thanks for the suggestion.   And I agree with you that maintaining a DB
server
> would
> turn out to be more scalable.
>
> I was wondering, what if I open 100 DB connections during the "init()" of
my
> Servlet.
> And, then each thread that handles a new HTTP request can share these
> connections.
>
> This way I need not develop a seperate DB layer class.  The only thing is
that I
> would
> be embedding the database specific code inside my Servlet instead of
keeping it
> in a
> transparent DB layer.
>
> Would you like to comment.  It'll be nice if you could share your opinion
too.
>
> Thanks,
> -- Anoop
>
>
>
>
>
>
> sushilkumar <[EMAIL PROTECTED]> on 05/02/2000 02:06:50 PM
>
> Please respond to "A mailing list for discussion about Sun Microsystem's
Java
>       Servlet API Technology." <[EMAIL PROTECTED]>
>
> To:   [EMAIL PROTECTED]
> cc:    (bcc: Anoop Maheshwari/HSS)
>
> Subject:  Re: A scalable architecture using Java Servlets
>
>
>
>
> Hi ,
> I think to let the servlet spawn 100 therads to do the data base
operations
> is the the most efficient way to tackle this situation .This may work now
> for 100 users but then the moment there will be 10000 users , this will be
a
> performance bottleneck .
>
> you can make a separate DB server to handle all the database request .
this
> dbserver will be a singleton class which will have a connection pool of
let
> us say 100 database connections and all the actuals database operations
like
> inserting , deleting , updation will be performed by this Dblayer .
>
> This Dbserver will interact to the outside world through a published
> interface .
> Whenever a request will come to the servlet for database opeartion servlet
> will get a reference to singleton dbserver class and if there are some
> connection free in the connection pool , it will take one connection and
> perform the desired operation .Once the database transaction finished ,
the
> connection is returned to the connection pool .
>
> This approach may be a better scalable option.just see if u r clear abt
what
> i said .
>
> -----Original Message-----
> From: Anoop Maheshwari [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 02, 2000 1:36 PM
> To: [EMAIL PROTECTED]
> Subject: A scalable architecture using Java Servlets
>
>
> Hi
>
> I want to web-enable a large Oracel 8i database using the Java Servlet
> technology.
>
> And, I need to support upto a 100 concurrent users.
>
> Could someone provide me pointers towards some possible architecture
> solutions
> that would live upto the expectations and be scalable for future growth.
>
> The way I understand, I can use the Servlets but then I'll have to do all
> the
> load
> balancing on the web-server side since I cannot possibly let my Servlets
> spawn
> 100 (or more) threads to serve 100 concurrent users.
>
> What I want to understand is how much can the Servlet do for me and how
much
> do
> I need to do apart from that.
>
> Thanks
> -- Snoopy
>
>
___________________________________________________________________________
> 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
>
>
___________________________________________________________________________
> 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
>
>
___________________________________________________________________________
> 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
>

___________________________________________________________________________
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

Reply via email to