Database Connection Pooling is typically handled (already) by the container. You can get your datasource from this connection pooling using JNDI. Spring has a way of doing this nicely using the JndiObjectFactoryBean. Each container has a different way to configure this JNDI configuration, so you need to read their documentation and play with it.

Now, ORMs typically do their own connection caching (e.g. Hibernate), but in my understanding, the prefer way of doing connection pooling is via JNDI, so as to use the JEE specification appropriately. In the Struts sample, I think TopLink (instead of Hibernate) is used. Alternatively, the commons DBCP does connection pooling for you as well (if you don't want to use JNDI and rely on the container for pooling). It's a matter of creating a new <bean id="datasource" ...> and let Spring inject the one you want.

Your choice, of course.

BTW, this is hardly a Struts question :)

Filipe David Manana wrote:
Hi all,

I want to create a web app with Struts 2 that is Oracle database driven.
Integrating Struts 2 + Spring 2 + JPA (as described in
http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html), how do I
configure Oracle database Connection Caching (pooling)?

Oracle's JDBC driver provided in the Oracle Instant Client package has a
Connection Cache implementation class (
oracle.jdbc.pool.OracleConnectionCacheImpl) which I can use in my JDBC code.
I have been unsuccessfully googling for how to enable this Connection
Caching feature with Struts 2 + Spring 2 + JPA.

Has anybody done it before?

--
Filipe David Manana,
[EMAIL PROTECTED]

Obvious facts are like secrets to those not trained to see them.


--

Alberto A. Flores
http://www.linkedin.com/in/aflores


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to