Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > connection pools for database and web sessions

Reply
Thread Tools

connection pools for database and web sessions

 
 
marvind
Guest
Posts: n/a
 
      02-01-2006
Hello,

I have to implement two sets of connection pools - one for JDBC
connections and the other for connections to HP service desk.

I guess I could use an abstract factory but I found out that I have to
duplicate a lot of code, mainly:

1. Making a lot of classes singletons
2. Write essentially the same connection pool class that contains the
hashtable

I tried using generics for both 1 (SingletonHolder) and 2 but I ran
into the following problems in both cases:
Due to Java's implementation of generics, I cannot declare a static
field with unknown type or in static methods.

So, my question is code duplication unavoidable (note all methods are
static and the application is multithreaded, so you may have to lock on
the class in some cases) or is there an elegant solution that I am
missing?

Thanks,
mar

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Databound controls and connection pools --> How does it work? Tom ASP .Net 2 09-13-2007 05:34 AM
Moving from ASP Sessions to Database Sessions Bookham Measures ASP General 19 08-23-2007 03:51 PM
Question about Database Connection Pools apue Java 1 07-23-2006 08:56 PM
Tomcat 4.0, MySQL and connection pools... Darryl L. Pierce Java 0 08-18-2003 08:15 PM
Maybe Database connection pools should be managed by Admins instead of Developers using Code? Eric Newton ASP .Net Security 0 08-15-2003 07:28 PM



Advertisments