second level cache without persistence.xml [message #1124572] |
Thu, 03 October 2013 13:25  |
Eclipse User |
|
|
|
I'm using eclipse link and spring as follow
<bean id="emf"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
<property name="generateDdl" value="false"/>
<property name="showSql" value="true" />
<property name="database" value="POSTGRESQL"/>
<property name="databasePlatform" value="org.eclipse.persistence.platform.database.PostgreSQLPlatform"/>
</bean>
</property>
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect"/>
</property>
<property name="loadTimeWeaver">
<bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
</property>
<property name="packagesToScan" value="org.omid.model"/>
<property name="jpaProperties">
<props>
<prop key="eclipselink.cache.shared.default">false</prop>
<prop key="eclipselink.query-results-cache">true</prop>
<prop key="eclipselink.logging.session">true</prop>
</props>
</property>
</bean>
as you can see because of packagesToScan I don't have persistence.xml.
my first question is how I can enable selective cache ?
I've tried this
@Entity
@Cacheable(true)
@Cache(
type=CacheType.SOFT, // Cache everything until the JVM decides memory is low.
size=64000, // Use 64,000 as the initial cache size.
expiry=36000000
)
public class Employee {
...
}
but it doesn't working.
am I missing something ?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05618 seconds