Hello all,
Here's my problem:
I'm working on a legacy
J2EE application that uses the DAO
pattern and implements all DAO's as singletons. There's one abstract DAO
superclass.
But this class holds the connection to the database as an instance
variable.
Which, in my opinion, is not
thread safe.
If multiple clients would make a call simultaneously, the very same
connection
would be used for the different calls, resulting in an exception on
the app server.
I think a different connection should be gotten from the datasource
connection
pool on everycall? And that the datasource itself should be an
instance variable.
All opinons are appreciated!
Thanks,
Koen