For sure,
Here is my Spring config:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="
http://www.springframework.org/schema/beans"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="
http://www.springframework.org/schema/context"
xmlns:tx="
http://www.springframework.org/schema/tx"
xmlns:ehcache="
http://ehcache-spring-annotations.googlecode.com/
svn/schema/ehcache-spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd">
<ehcache:annotation-driven cache-manager="ehCacheManager" />
<bean id="ehCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>
<!-- these two configs are necessary for the autowired/component
annotation stuff.
Setting the base-backage is necessary - otherwise it won't work. Be
warned:
if setting it to an unrestrictive value like "com", the scanning can
get very time consuming
-->
<!-- context:annotation-config/-->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:configuration.properties</value>
</property>
</bean>
<!-- ============================== DATASOURCE
============================== -->
<!-- org.apache.commons.dbcp.BasicDataSource -->
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-
method="close">
<property name="driverClass" value="oracle.jdbc.OracleDriver" />
<property name="jdbcUrl" value="${db.url}" />
<property name="user" value="${db.username}" />
<property name="password" value="${db.password}" />
<property name="minPoolSize" value="5" />
<property name="maxPoolSize" value="50" />
<property name="initialPoolSize" value="5" />
<property name="maxIdleTime" value="1800" />
<property name="maxConnectionAge" value="43200" />
<property name="idleConnectionTestPeriod" value="1800" />
<property name="preferredTestQuery" value="SELECT 1 FROM DUAL" />
<property name="autoCommitOnClose" value="false" />
</bean>
<!-- ========== TRANSACTION MANAGER ========== -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
<property name="nestedTransactionAllowed" value="true" />
</bean>
<!-- importing other spring files-->
<import resource="classpath:capacityplanning-spring-daos.xml" />
<import resource="classpath:capacityplanning-spring-services.xml" />
</beans>
Here is the complete log message:
....
2010-07-22 15:33:52,305 [main] WARN net.sf.ehcache.CacheManager -
Creating a new instance of CacheManager using the diskStorePath "C:
\Users\thwinkle\wokspace_helios\CapacityPlanningAPI" which is already
used by an existing CacheManager.
The source of the configuration was
net.sf.ehcache.config.generator.ConfigurationSource
$DefaultConfigurationSource@b9b8d0.
The diskStore path for this CacheManager will be set to C:\Users
\thwinkle\wokspace_helios\CapacityPlanningAPI
\ehcache_auto_created_1279805632305.
To avoid this warning consider using the CacheManager factory methods
to create a singleton CacheManager or specifying a separate ehcache
configuration (ehcache.xml) for each CacheManager instance.
.....
Here is my ehcache.xml:
<ehcache xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false">
<diskStore path="user.dir"/>
<defaultCache
maxElementsInMemory="5000"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="120"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
<cache name="com.sonydadc.capacityplanning.api.slaIdcache"
maxElementsInMemory="5000"
eternal="false"
timeToLiveSeconds="300"
overflowToDisk="false">
</cache>
<cache name="com.sonydadc.capacityplanning.api.leadTimecache"
maxElementsInMemory="5000"
eternal="false"
timeToLiveSeconds="300"
overflowToDisk="false">
</cache>
<cache name="com.sonydadc.capacityplanning.api.minTatcache"
maxElementsInMemory="5000"
eternal="false"
timeToLiveSeconds="300"
overflowToDisk="false">
</cache>
<cache name="com.sonydadc.capacityplanning.api.timezonecache"
maxElementsInMemory="5000"
eternal="false"
timeToLiveSeconds="300"
overflowToDisk="false">
</cache>
</ehcache>
Thanks in advance...