[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] descriptor.disableCacheHits() does not disable cache hits
|
Again thanks for the quick reply
My problem still the same: How can is see that now cache is being hit not
the databse
My spring configuration file enable to show sql
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean
class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
<property name="showSql" value="true" />
<property name="generateDdl" value="false" />
<property name="databasePlatform"
value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>
</bean>
</property>
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"
/>
</property>
</bean>
Modified Code snippet to link pk and entity manager refresh
@Cache (
type=CacheType.WEAK,
expiry=600000,
refreshOnlyIfNewer=true,
disableHits=false,
coordinationType=CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES
)
@NamedQueries( {
@NamedQuery(name = "CodFlexCodesB.findAll",
query = "select o from CodFlexCodesB o"),
@NamedQuery(name = "CodFlexCodesB.timeValidity",
query = "SELECT em FROM CodFlexCodesB em " +
"WHERE em.id = :pk AND em.codFlexCodeSystemsB.id = :id AND " +
"(em.startDate <= :endDate OR :endDate IS NULL ) AND (em.endDate
>= :startDate OR em.endDate IS NULL) ",
hints = {@QueryHint(name=QueryHints.CACHE_USAGE,
value=CacheUsage.ConformResultsInUnitOfWork
),@QueryHint(name=QueryHints.REFRESH,value=HintValues.TRUE)}
)
})
Still log shows two quries
Size 1
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--SELECT
t0.ID, t0.CREATED_BY, t0.CREATION_DATE, t0.END_DATE, t0.LAST_UPDATED_BY,
t0.LAST_UPDATED_DATE, t0.LAST_UPDATE_LOGIN, t0.OBJECT_VERSION_NUMBER,
t0.START_DATE, t0.VALUE_DATE1, t0.VALUE_DATE2, t0.VALUE_DATE3,
t0.VALUE_DATE4, t0.VALUE_DATE5, t0.VALUE_DATE6, t0.VALUE_DATE7,
t0.VALUE_DATE8, t0.VALUE_NR1, t0.VALUE_NR2, t0.VALUE_NR3, t0.VALUE_NR4,
t0.VALUE_NR5, t0.VALUE_NR6, t0.VALUE_NR7, t0.VALUE_NR8, t0.FLCO_ID8,
t0.FLCO_ID3, t0.FCSY_ID, t0.STATUS_ID, t0.FLCO_ID1, t0.FLCO_ID7,
t0.FLCO_ID9, t0.FLCO_ID4, t0.FLCO_ID6, t0.FLCO_ID2, t0.FLCO_ID5 FROM
COD_FLEX_CODES_B t0, COD_FLEX_CODE_SYSTEMS_B t1 WHERE (((((t0.ID = ?) AND
(t1.ID = ?)) AND ((t0.START_DATE <= ?) OR (? IS NULL))) AND ((t0.END_DATE >=
?) OR (t0.END_DATE IS NULL))) AND (t1.ID = t0.FCSY_ID))
bind => [9592, 10001, 2008-08-26 16:44:54.578, 2008-08-26 16:44:54.578,
2008-08-16 16:44:54.578]
>>>>><<<<< false
Size 0
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--SELECT
t0.ID, t0.CREATED_BY, t0.CREATION_DATE, t0.END_DATE, t0.LAST_UPDATED_BY,
t0.LAST_UPDATED_DATE, t0.LAST_UPDATE_LOGIN, t0.OBJECT_VERSION_NUMBER,
t0.START_DATE, t0.VALUE_DATE1, t0.VALUE_DATE2, t0.VALUE_DATE3,
t0.VALUE_DATE4, t0.VALUE_DATE5, t0.VALUE_DATE6, t0.VALUE_DATE7,
t0.VALUE_DATE8, t0.VALUE_NR1, t0.VALUE_NR2, t0.VALUE_NR3, t0.VALUE_NR4,
t0.VALUE_NR5, t0.VALUE_NR6, t0.VALUE_NR7, t0.VALUE_NR8, t0.FLCO_ID8,
t0.FLCO_ID3, t0.FCSY_ID, t0.STATUS_ID, t0.FLCO_ID1, t0.FLCO_ID7,
t0.FLCO_ID9, t0.FLCO_ID4, t0.FLCO_ID6, t0.FLCO_ID2, t0.FLCO_ID5 FROM
COD_FLEX_CODES_B t0, COD_FLEX_CODE_SYSTEMS_B t1 WHERE (((((t0.ID = ?) AND
(t1.ID = ?)) AND ((t0.START_DATE <= ?) OR (? IS NULL))) AND ((t0.END_DATE >=
?) OR (t0.END_DATE IS NULL))) AND (t1.ID = t0.FCSY_ID))
bind => [9592, 10001, 2008-07-25 16:44:54.578, 2008-07-25 16:44:54.578,
2008-07-26 16:44:54.578]
Size 0
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--SELECT
LANGUAGE, CREATED_BY, CREATION_DATE, ID, KEY_VALUE, LAST_UPDATED_BY,
LAST_UPDATED_DATE, LAST_UPDATE_LOGIN, OBJECT_VERSION_NUMBER, SOURCE_LANG,
VALUE_CHAR1, VALUE_CHAR2, VALUE_CHAR3, VALUE_CHAR4, VALUE_CHAR5,
VALUE_CHAR6, VALUE_CHAR7, VALUE_CHAR8 FROM COD_FLEX_CODES_TL WHERE (ID = ?)
bind => [9592]
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--SELECT
ID, CREATED_BY, CREATION_DATE, END_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE,
LAST_UPDATE_LOGIN, OBJECT_VERSION_NUMBER, START_DATE, VALUE_DATE1,
VALUE_DATE2, VALUE_DATE3, VALUE_DATE4, VALUE_DATE5, VALUE_DATE6,
VALUE_DATE7, VALUE_DATE8, VALUE_NR1, VALUE_NR2, VALUE_NR3, VALUE_NR4,
VALUE_NR5, VALUE_NR6, VALUE_NR7, VALUE_NR8, FLCO_ID8, FLCO_ID3, FCSY_ID,
STATUS_ID, FLCO_ID1, FLCO_ID7, FLCO_ID9, FLCO_ID4, FLCO_ID6, FLCO_ID2,
FLCO_ID5 FROM COD_FLEX_CODES_B WHERE (ID = ?)
bind => [9592]
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--SELECT
ID, CREATED_BY, CREATION_DATE, END_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE,
LAST_UPDATE_LOGIN, OBJECT_VERSION_NUMBER, START_DATE, VALUE_DATE1,
VALUE_DATE2, VALUE_DATE3, VALUE_DATE4, VALUE_DATE5, VALUE_DATE6,
VALUE_DATE7, VALUE_DATE8, VALUE_NR1, VALUE_NR2, VALUE_NR3, VALUE_NR4,
VALUE_NR5, VALUE_NR6, VALUE_NR7, VALUE_NR8, FLCO_ID8, FLCO_ID3, FCSY_ID,
STATUS_ID, FLCO_ID1, FLCO_ID7, FLCO_ID9, FLCO_ID4, FLCO_ID6, FLCO_ID2,
FLCO_ID5 FROM COD_FLEX_CODES_B WHERE (ID = ?)
bind => [9592]
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--DELETE
FROM COD_FLEX_CODES_TL WHERE ((ID = ?) AND (LANGUAGE = ?))
bind => [9592, NL]
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--DELETE
FROM COD_FLEX_CODES_TL WHERE ((ID = ?) AND (LANGUAGE = ?))
bind => [9592, US]
[EL Fine]: 2008.08.05
16:44:54.578--ClientSession(17489534)--Connection(9790036)--Thread(Thread[main,5,main])--DELETE
FROM COD_FLEX_CODES_B WHERE (ID = ?)
bind => [9592]
elygre wrote:
>
> While working with caching, I have customized a class descriptor, calling
> "descriptor.disableCacheHits();". I figured that this would make multiple
> calls to "em.find(key)" generate multiple SQL-statements to the database.
>
>
>
> This does not happen, and then I wonder why. There is really not much else
> going on, in terms of configuration and setup. Anything I need to switch
> on?
>
>
>
> Eirik
>
>
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
--
View this message in context: http://www.nabble.com/descriptor.disableCacheHits%28%29-does-not-disable-cache-hits-tp18826932p18832757.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.