On Wed, 10 Apr 2002, rainer jünger wrote:

> Date: Wed, 10 Apr 2002 18:42:39 +0200
> From: rainer jünger <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: Tomcat 4.x and Database Connection Pooling
>
> Hi Craig,
>
> > > So what will Tomcat Users do? Will Tomcat get a container manages
> connection
> > > pool?
> >
> > http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html
> >
> > > What is the reason for removing it form Struts?
> >
> > That was a hypothetical example of a possible future situation that would
> > cause the need to change your code.
>
> Sorry somehow I don't understand your answer.

Struts is *******NOT******* going to remove its own connection pool :-).

However, the internal implementation is changing in Struts 1.1 to use the
commons-dbcp implementation underneath.

The person who made this comment was illustrating a *possible* scenario:
- You write your app against the Struts APIs
- Struts removed its connection pool
- You now have to rewrite your apps

Although this particular scenario won't happen, it does illustrate the
potential for problems of reliance on specific APIs versus standardized
approaches (when they exist).

> Did you wont to give me a hint that I can avoid to change the code in future
> by using JNDI?
>

Struts developers who are writing apps for J2EE app servers, or servlet
containers that support JNDI, should definitely use JNDI based data
sources.  This is the standard, portable, API for accessing resources.

> Still, what will happen to the Connection Pooling in future in Struts or in
> Tomcat?
>

Struts:  The connection pool API (org.apache.struts.util.GenericDataSource),
the corresponding configuration in struts-config.xml, and the way to retrieve
data sources from ActionServlet, will remain in Struts -- backwards
compatibility is a key Struts feature.  The internal implementation will
change, but the APIs will not.

Tomcat:  As far as I'm concerned, JNDI support is a "now and forever more"
feature of Tomcat 4 and later.  It's the standard access mechanism for
J2EE app servers as well.

Recommendation:  If you can, you should use JNDI based access to data
sources.  This is both portable across containers, and portable across
Struts versus non-Struts applications.  In addition, it can be used from
directly from within a JavaBean implementing your business logic, without
requiring a reference to ActionServlet or the servlet context (or the web
layer at all).

> thanks,
> rainer juenger
>

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to