-->
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: MySQL SQL_NO_CACHE with HibernateTemplate.load(...)
PostPosted: Wed Oct 06, 2010 3:48 pm 
Newbie

Joined: Wed Oct 06, 2010 3:39 pm
Posts: 1
Hello,

I've an interesting problem where the shared MySQL db server I am using uses MySQL query caching:

http://dev.mysql.com/doc/refman/5.1/en/query-cache.html

Sadly one particular section of my code involves reading a row from a table then updating it immediately afterwards. Hence invalidating the cache. Ideally I want to set SQL_NO_CACHE with in the SQL statement:

http://dev.mysql.com/doc/refman/5.1/en/ ... elect.html

Although I'd prefer not to construct this from hand. Does anyone know if it is possible to specific in hibernate an option to include this for a particular load on hibernate template?

My code:

getHibernateTemplate().load(loginRecord, user.getId());

I have seen other information regarding the hibernate query cache, i.e. setCachable(true) etc, although we are not using any of these caches, we are using the query cache instead.

Any ideas? Or do i simply need to construct the statement in SQL and pass this to hibernate?

Cheers,

Mark.


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.