-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: identity of objects returned from jvm cache
PostPosted: Tue Mar 02, 2004 6:34 am 
Beginner
Beginner

Joined: Wed Feb 11, 2004 6:08 am
Posts: 29
Location: Germany
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.