Re: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
Filipe, Funny, I was looking for the same information. Here's the Spring configuration I'm moving forward with to use the Oracle connection pooling: !-- Database connection using the Oracle connection pool -- bean id=dataSource class=oracle.jdbc.pool.OracleConnectionCacheImpl property name=connectionPoolDataSource bean class=oracle.jdbc.pool.OracleConnectionPoolDataSource property name=URL value=jdbc:oracle:thin:@devlxdb02:1522:xx / property name=user value=xx / property name=password value=xx / /bean /property property name=maxLimit value=10 / property name=minLimit value=2 / /bean Seems to work for now. There is probably a less verbose way to do this. And yes I agree this isn't a Struts question, but I hope it helps. thx, Ken K -- View this message in context: http://www.nabble.com/Struts-2-%2B-Spring-2-%2B-JPA-%2B-Oracle-%2B-Connection-Caching-Pooling-tp14284397p14398750.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
Thanks! :) By the way, I have bad news... The OracleConnectionCachingImpl class is actually deprecated. Use OracleConnectionCacheManager with OracleDataSource instead. Take a look at: oracle JDBC reference: http://download-west.oracle.com/docs/cd/B12037_01/java.101/b10979/toc.htm oracle JDBC resources: http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/oracle10g/conncache/Readme.html Found it 2 days ago, thanks to an Eclipse warning :) How to port this to Spring/Struts2 I have no idea... I am actually doing my Model layer using directly jdbc. cheers On 12/18/07, kenk [EMAIL PROTECTED] wrote: Filipe, Funny, I was looking for the same information. Here's the Spring configuration I'm moving forward with to use the Oracle connection pooling: !-- Database connection using the Oracle connection pool -- bean id=dataSource class=oracle.jdbc.pool.OracleConnectionCacheImpl property name=connectionPoolDataSource bean class= oracle.jdbc.pool.OracleConnectionPoolDataSource property name=URLvalue= jdbc:oracle:thin:@devlxdb02:1522:xx / property name=user value=xx / property name=password value=xx / /bean /property property name=maxLimit value=10 / property name=minLimit value=2 / /bean Seems to work for now. There is probably a less verbose way to do this. And yes I agree this isn't a Struts question, but I hope it helps. thx, Ken K -- View this message in context: http://www.nabble.com/Struts-2-%2B-Spring-2-%2B-JPA-%2B-Oracle-%2B-Connection-Caching-Pooling-tp14284397p14398750.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them.
Re: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
I have no idea how to do that, but it isn't specific to Struts or JPA. Spring documentation would be the best place to look that up I guess. musachy On Dec 11, 2007 4:56 PM, Filipe David Manana [EMAIL PROTECTED] 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. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
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]