-->
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: Is it a bug or do I misuse it ? (about SQL Query Cache)
PostPosted: Mon Oct 13, 2008 4:16 am 
Newbie

Joined: Tue Oct 07, 2008 4:43 am
Posts: 2
Location: Guangzhou, China
Hibernate version:core 3.1 - 3.3.1
Code :
query = session.createSQLQuery(querySql)
List resultList = query.list();


Full stack trace of any exception that occurs:none

Name and version of the database you are using:oracle 10g

The generated SQL (show_sql=true):
sql might be: select a.* from A a, B b where a.f = b.f;


Debug level Hibernate log excerpt:


Hibernate SQL Query Cache
2008-10-8

Hibernate 3.1+, JDK 1.4

Is it a bug or do I misuse it ?

The bug occurs when using sencond level cache and query cache on SQL Query Cache. i.e. In a two-table-related SQL Query, cache is not updated when reference table is modified(create ,update, delete).
e.g.
Java code :
Q(A) = session.createSQLQuery(querySql)
hbm.xml, A,B both use cache .

The Query Q(A)=q{A,B} needs two tables A and B for data query , and table A as the resultset structure.

sql might be:
select a.* from A a, B b where a.f = b.f;

the query operation is:
List resultList = query.list();

When reference table B is modified, e.g. session.delete(b0) and the result of Q(A) should change. But the query result is the same. I guess the query cache isn't updated. Multiple-table-related query might be the same.

And I try to fix it by modifying class SQLCustomQuery myself. If it is a bug, I can post the code.


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.