|
Hi Brad, Am Donnerstag, 10. Januar 2002 00:45 schrieben Sie: > Allright, after taking a walk with the dog and clearing my > head, and thinking.. it made sense. > > I wasn't making the ConnectionPool object static. Once I > did that, it reused availble connections. you should make it a Singleton (an object existing only once) - write a private default Constructor (so you can't initiate an object by Constructor) - write a static method getInstance to get an object of the class; this method creates an object, if it doesn't exist and stores the reference in a class variable and returns this variable in every case this approach controlls the usage of your pool objects; in your solution with the static pool the garbage collector might throw away your pool > > But, lets assume I have multiple clients. Will this object > pool be available for all of them to use? > > Client 1 creates connection 1 > Client 2 creates connection 2 > Client 1 releases connection 1 > Client 3 uses connection 1 > > That's the part I guess I'm having a hard time visualizing. > Is a static object on the server available to all how use > it? > _______________________________________________ > This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) > mailing list To post a message email: JAVA400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l > or email: JAVA400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/java400-l. -- mfG Dieter Bender DV-Beratung Dieter Bender Wetzlarerstr. 25 35435 Wettenberg Tel. +49 641 9805855 Fax +49 641 9805856 www.bender-dv.de
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.