-->
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: unwanted insert on a query AND legitimate uses of evict?
PostPosted: Mon Dec 19, 2005 2:12 pm 
Newbie

Joined: Mon Dec 19, 2005 1:40 pm
Posts: 1
I am sorry that this is so vague, but perhaps someone here can help. I am using Spring and Hibernate 3 in a web application. I need to perform a query on the database. The Hibernate session is managing a dirty object that corresponds to a row in the table being queried. I do not want Hibernate to update the table before the table is queried, but when I do a getHibernateTemplate.find(), this is what hibernate does.

I have solved the problem by using getHibernateTemplate.evict() on the object, but my impression from _Hibernate_in_Action_ is that this use of evict is discouraged.

So, my questions are: What is a good strategy to pursue? Is it good to use evict() in this way? In general, what kinds of things is it acceptable to use evict() for (other than performance)?

You may not be able to give precise answers to these questions, but if you could give me some leads where I could go to research this question, that would be great, too.


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.