-->
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: cached query skipped --> no results shown
PostPosted: Tue Aug 02, 2005 5:22 am 
Newbie

Joined: Tue May 17, 2005 4:54 am
Posts: 15
Location: Germany, Karlsruhe
Hello,

I have a problem with caching:
Everytime I select a list of records from the database, these are cached by hibernate, as the following log excerpt underlines:

Code:
The query is already compiled, s
kipping...
2005-08-02 11:18:38,506 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] flushing session
2005-08-02 11:18:38,506 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades



There is no exception thrown, but in fact, I don't get any results shown (in my web application)!

Reloading the site for a second time seems to mark the cache dirty and thus the query is re-compiled, so my results are shown again. Then reloading again leads to a blank page.

How can I avoid this?
I've alread set hibernate.cache.use_query_cache to false.
But acutally I'm looking to a solution that uses cache (for performance reasons).


Hibernate version: 3

The generated SQL (show_sql=true): none generated because cached

Debug level Hibernate log excerpt:

Code:
2005-08-02 11:18:38,505 DEBUG [org.hibernate.impl.SessionImpl] find: FROM Person p LEFT JOIN p.firma f
2005-08-02 11:18:38,505 DEBUG [org.hibernate.engine.QueryParameters] named parameters: {}
2005-08-02 11:18:38,506 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] compile() : The query is already compiled, s
kipping...
2005-08-02 11:18:38,506 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] flushing session
2005-08-02 11:18:38,506 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] processing cascade ACTION_SAVE_UPDATE for: com.mdpro.pro
tokolldb.models.Protokoll
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: com.mdpro.pro
tokolldb.models.Protokoll.protokollteilnehmer
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: com.mdpr
o.protokolldb.models.Protokoll.protokollteilnehmer
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] deleting orphans for collection: com.mdpro.protokolldb.m
odels.Protokoll.protokollteilnehmer
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] done deleting orphans for collection: com.mdpro.protokol
ldb.models.Protokoll.protokollteilnehmer
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: com.mdpro.pro
tokolldb.models.Protokoll.tops
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: com.mdpr
o.protokolldb.models.Protokoll.tops
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] deleting orphans for collection: com.mdpro.protokolldb.m
odels.Protokoll.tops
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] done deleting orphans for collection: com.mdpro.protokol
ldb.models.Protokoll.tops
2005-08-02 11:18:38,506 DEBUG [org.hibernate.engine.Cascades] done processing cascade ACTION_SAVE_UPDATE for: com.mdpr
o.protokolldb.models.Protokoll
2005-08-02 11:18:38,507 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
2005-08-02 11:18:38,507 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushing entities and processing
referenced collections
2005-08-02 11:18:38,507 DEBUG [org.hibernate.engine.Collections] Collection found: [com.mdpro.protokolldb.models.Proto
koll.protokollteilnehmer#1], was: [com.mdpro.protokolldb.models.Protokoll.protokollteilnehmer#1] (uninitialized)
2005-08-02 11:18:38,507 DEBUG [org.hibernate.engine.Collections] Collection found: [com.mdpro.protokolldb.models.Proto
koll.tops#1], was: [com.mdpro.protokolldb.models.Protokoll.tops#1] (uninitialized)




Does anyone has advice?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 02, 2005 5:43 am 
Newbie

Joined: Tue May 17, 2005 4:54 am
Posts: 15
Location: Germany, Karlsruhe
I temporarily circumvented the problem by setting

session.setFlushMode(FlushMode.NEVER);

If there are "better" solutions, please let me know. Thank you.


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.