Right, since I seem to be the only alien having this problem I would be happy to know how you write jdbc classes and (if any) a datasource manager.
Do you create a separate class for retrieving connections or datasources. Are the methods static. How do your dao's code look like? For example when using a connection, statement, resultset. How and where do you close them, and do you return values afterwards. Do you use the factory pattern? Any code examples, step by step guide of something that works would be very helpful. Basically, a great step by step tutorial would be more helpful than trying to spot my problem as everyone seems to have a different opinion from the other. Frankly speaking, I believe there is no sufficient and a spot-on-clear documentation of what thread safe servlet containers really mean and the usage of static methods on these servlet containers. The current documentation can be understood in many different ways. What interests me more about this thread is that many people suggested to avoid using static methods in web applications. Avoiding static methods for DAO's is understandable, but avoiding static methods for retrieving a datasource seems strange. I have seen millions (if not zillions) code examples on the net where static methods are used for retrieving datasources. So I would be happy to see how others write code without static methods. Thanks, Sinoea > From: [EMAIL PROTECTED] > To: users@tomcat.apache.org > Date: Wed, 17 Sep 2008 22:26:16 -0500 > Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections > keepincreasing.... > >> From: sinoea kaabi [mailto:[EMAIL PROTECTED] >> Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active >> connections keepincreasing.... >> >> 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. > > Absolutely - Johnny K's suggestion of doing a new every time is utter > nonsense. > >> So is a connection a thread-safe object or not? > > No, a connection is not thread-safe: it is designed to be be used by only one > thread at a time. If you have multiple threads accessing a connection object > *simultaneously*, you will have problems. On the other hand, connection > managers (e.g., the commons-dbcp code) are thread-safe; multiple threads may > call one simultaneously to acquire connection objects, and each thread is > guaranteed to be given a separate object. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you received > this in error, please contact the sender and delete the e-mail and its > attachments from all computers. > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _________________________________________________________________ Make a mini you and download it into Windows Live Messenger http://clk.atdmt.com/UKM/go/111354029/direct/01/ --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]