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: Unintended Updates
PostPosted: Mon Aug 17, 2009 11:47 am 
Newbie

Joined: Thu Jul 23, 2009 11:48 am
Posts: 9
Hopefully this is an easy question. I have a function that just does a find(), like this:
Code:
List employerResults = getHibernateTemplate().find("from EmployerInfo where upper(name) like upper(?)", searchString);
return employerResults;

But my output shows that database updates are happening, like this:
Code:
Hibernate: select employerin0_.employer_id as employer1_0_, employerin0_.employer_name as employer2_0_, employerin0_.employer_password as employer3_0_, employerin0_.jpu_jobp_user_id as jpu4_0_ from general.zjp_employers employerin0_ where upper(employerin0_.employer_name) like upper(?)
Hibernate: select contactpoi0_.emp_employer_id as emp3_1_, contactpoi0_.contact_point_id as contact1_1_, contactpoi0_.contact_point_id as contact1_7_0_, contactpoi0_.contact_point as contact2_7_0_, contactpoi0_.emp_employer_id as emp3_7_0_, contactpoi0_.ctp_contact_type_id as ctp4_7_0_ from general.zjp_contact_points contactpoi0_ where contactpoi0_.emp_employer_id=?
Hibernate: select contactpoi0_.emp_employer_id as emp3_1_, contactpoi0_.contact_point_id as contact1_1_, contactpoi0_.contact_point_id as contact1_7_0_, contactpoi0_.contact_point as contact2_7_0_, contactpoi0_.emp_employer_id as emp3_7_0_, contactpoi0_.ctp_contact_type_id as ctp4_7_0_ from general.zjp_contact_points contactpoi0_ where contactpoi0_.emp_employer_id=?
Hibernate: select contactpoi0_.contact_type_id as contact1_8_0_, contactpoi0_.contact_type as contact2_8_0_ from general.zjp_contact_types contactpoi0_ where contactpoi0_.contact_type_id=?
Hibernate: update general.zjp_contact_points set emp_employer_id=null where emp_employer_id=?
Hibernate: update general.zjp_contact_points set emp_employer_id=null where emp_employer_id=?
Hibernate: update general.zjp_contact_points set emp_employer_id=? where contact_point_id=?
Hibernate: update general.zjp_contact_points set emp_employer_id=? where contact_point_id=?
Hibernate: update general.zjp_contact_points set emp_employer_id=? where contact_point_id=?
Hibernate: update general.zjp_contact_points set emp_employer_id=? where contact_point_id=?

Why is a find() causing updates, and how can I stop that?


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.