"A.L." wrote:

> I have created a servlet class (using
> DBConenctionbroker from javaexchange) which upon
> initialization creates a number of database
> conenctions.   The init method is the only method
> defined.
>
> My plan now is to create a number of servlets which
> extend this class by defining doGet methods, which
> will also return specific information from a database.
>  My question is if each of these classes are child
> classes of my connection broker class, how connection
> brokers will be created.  In other words:
> Lets say I hae my connection broker and three child
> classes. If upon initialization my connectionBroker
> class actually creates 3 database connections.  How
> many database conenctions will there be once all the
> servlets are initialized?
>
> Will there simply be 3 for the connectionBroker,
> 9 for each of the child servlets,
> or twelve for all the servlets?
>
> Again I will probably have all 4 servlets intialize
> upon tomcat startup.
>
> Thanks,
>    -Amos
> [...]

I am not sure, I think it is possible to use "static class field" to
control/count the number
of instances if there is only-one classloader, just as a reference :-)


Bo
Aug.22, 2001


Reply via email to