----- Original Message ----- From: "sinoea kaabi" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, September 17, 2008 4:48 PM
Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....



This question about static variables seems a bit deeper than I
thought, the more I think about it the more confused I get.

I could accept the fact that we should create new objects of Dao's,
but for getting a datasource or connection it should make sense
to have a utility class with static methods.

Collection<Branch> branches = new BranchDao().loadBranches(
new DBUtil().getDataSource(), // This feels crap, I'd rather use DBUtil.getDataSource() (without new)
1);


DBUtil should have static methods for retrieving a datasource or a connection,
creating a new DBUtil for each request does not feel right.
----------------------
Are you an ex C programmer....
Sounds like it... theres a couple strange feeling things in Java...

   String x = new Thing();

in a loop is something else you see.... a C programmer wants to stick the
declaration outside the loop... so its easy to clean up.... java nah... that garbage collector is pure magic ;)

You get used of it...

There is a pretty good threading tut in the famous Java Tutorial...
Normal stuff, like race conditions... yada yada... its good reading
but when you actually doing it... its a feeling... because its a timing issue.
No error message that says anything... just wrong values.

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to