hello,
I have a class configured to be cached via jvm / ehcache:
Code:
<cache usage="read-only"/>
now I query the same instance two times, i.e. :
Code:
Order o1 = session.createQuery(HQL_FIND_ID123) ;
Order o2 = session.createQuery(HQL_FIND_ID123);
Using the cache I expected that not only o1.equals(o2) but also o1==o2 (because the cache is supposed to return the same instance previously queries). Is that wrong ?! Does the cache return a new instance "o2" with data copied from "o1" ?!
my cached seems to be configured correctly:
Code:
[02.03.04 11:20:45:520 CET] 466dde47 DatasourceCon I net.sf.hibernate.connection.DatasourceConnectionProvider Using datasource: java:comp/env/jdbc/LPBACKEND
[02.03.04 11:20:45:540 CET] 466dde47 TransactionMa I net.sf.hibernate.transaction.TransactionManagerLookupFactory No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
[02.03.04 11:20:47:202 CET] 466dde47 WSRdbDataSour u Database version is
05.01.0000 V5R1m0
[02.03.04 11:20:47:202 CET] 466dde47 WSRdbDataSour u JDBC Driver version is
5.0
[02.03.04 11:20:47:312 CET] 466dde47 SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Use scrollable result sets: true
[02.03.04 11:20:47:312 CET] 466dde47 SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Use JDBC3 getGeneratedKeys(): false
[02.03.04 11:20:47:312 CET] 466dde47 SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Optimize cache for minimal puts: false
[02.03.04 11:20:47:312 CET] 466dde47 SettingsFacto I net.sf.hibernate.cfg.SettingsFactory echoing all SQL to stdout
[02.03.04 11:20:47:322 CET] 466dde47 SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Query language substitutions: {}
[02.03.04 11:20:47:322 CET] 466dde47 SettingsFacto I net.sf.hibernate.cfg.SettingsFactory cache provider: net.sf.ehcache.hibernate.Provider
[02.03.04 11:20:47:332 CET] 466dde47 Configuration I net.sf.hibernate.cfg.Configuration instantiating and configuring caches
[02.03.04 11:20:47:472 CET] 466dde47 SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl building session factory