S
Simon Harvey
Hi,
I am hoping that someone could offer some general advice on thread safety
when using helper classes and helper java beans.
In particular I am worried about a javabean that I have made that handles
connection pooling and executing queries.
I decalre the datasource at the top of the class and then use it in a couple
of methods to execute a given statement.
At its simplest, my question is, if this class is used by lots of jsp pages
to get data, is it thread safe?
The other thing is, is there someway to make only one helper object and
share it amongst various requesting pages? At the moment I think that each
page makes a new helper javabean in order to execut its statement. Given
that I want to share connections amongst pages, should I somehow be making
sure that each page that is handling a request is going through only one
instance of the helper class? How should I do this?
Thanks everyone
Kindest Regards
Simon
I am hoping that someone could offer some general advice on thread safety
when using helper classes and helper java beans.
In particular I am worried about a javabean that I have made that handles
connection pooling and executing queries.
I decalre the datasource at the top of the class and then use it in a couple
of methods to execute a given statement.
At its simplest, my question is, if this class is used by lots of jsp pages
to get data, is it thread safe?
The other thing is, is there someway to make only one helper object and
share it amongst various requesting pages? At the moment I think that each
page makes a new helper javabean in order to execut its statement. Given
that I want to share connections amongst pages, should I somehow be making
sure that each page that is handling a request is going through only one
instance of the helper class? How should I do this?
Thanks everyone
Kindest Regards
Simon