-->
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.  [ 2 posts ] 
Author Message
 Post subject: Oracle 10g/Hibernate 3 query does not refresh with new data
PostPosted: Wed Jan 10, 2007 10:48 pm 
Newbie

Joined: Mon Jan 08, 2007 11:57 am
Posts: 1
I am using EJB3/Hibernate3 and I am having problem with my query picking up data updated by another user or application unless a new session is initiated or entity manager is cleared.

I have tried my best with all configurations to the best of my knowledge. I could not find a way to force the query to pick up fresh data from the database. Any help will be very much appreciated.


I have tried this:
<property name="hibernate.cache.use_query_cache" value="false" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />

also at the query level:
emqry.setHint("org.hibernate.cacheable",new Boolean(false));
// logger.info("org.hibernate.cacheable is false");
// emqry.setHint("org.hibernate.cacheMode",org.hibernate.CacheMode.REFRESH);
// logger.info("org.hibernate.cacheMode REFRESH");
logger.info("Query Impl "+emqry.getClass().getName());
//emqry.setHint()
// emqry.setFlushMode(javax.persistence.FlushModeType.AUTO);

None of these settings are forcing my query to pick up fresh data. Also
implemented my own cache provider which does nothing and passed it through hibernate.cache.provider_class property. None of the properties I set above is changing the behaviour.

PLEASE, ANY HELP OR HINTS TO PIONT ME IN THE RIGHT DIRECTION as this is a major issue for our development work.

I tested with local HSQL database which seems to work fine.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 7:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
That's because Hibernate enforce a natural repeatable read wich is *good*.
If you want to break that, you can use em.refresh(object);

_________________
Emmanuel


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

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.