-->
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: Select Invokes Update Automatically Without My Permission
PostPosted: Mon Feb 13, 2006 12:18 pm 
Newbie

Joined: Thu Feb 09, 2006 1:22 pm
Posts: 13
Location: Turkey
hi all,

i think i have got a simple problem but i was not be able to find the trick. So, here my mapper :

<!-- BUTCE -->
<class name="tr.com.usta.ITBMuhasebeOrtak.core.dvo.muhasebe.Butce" table="U_BUTCE">
<id name="butcekod" column="BUTCEKOD">
</id>
<property name="hesapkod" column="HESAPKOD" length="30" not-null="false"/>
<property name="borc" column="BORC" type="double" not-null="true"/>
<property name="alacak" column="ALACAK" type="double" not-null="true"/>
<property name="dovizborc" type="double" column="DOVIZBORC" not-null="true"/>
<property name="dovizalacak" column="DOVIZALACAK" type="integer" not-null="true"/>
<property name="pbkod" column="PBKOD" length="5" not-null="false"/>
<property name="tarih" column="TARIH" type="date" not-null="false"/>
<property name="aciklama2" column="ACIKLAMA2" length="100" not-null="false"/>
<property name="aciklama" column="ACIKLAMA" length="100" not-null="false"/>
</class>

This table uses sequence to get id for 'BUTCEKOD'. After i call my select method to get data from table it gets data as i see from console Logging but after selection it tries to update also. Like that :

update
U_BUTCE
set
HESAPKOD=?,
BORC=?,
ALACAK=?,
DOVIZBORC=?,
DOVIZALACAK=?
PBKOD=?,
TARIH=?,
ACIKLAMA2=?,
ACIKLAMA=?
where
BUTCEKOD=?

Why hibernate needs to update the result list. Is it related with the table that takes its id from sequence?

Regards,

_________________
eRoHaN


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 13, 2006 4:53 pm 
Newbie

Joined: Wed Oct 12, 2005 7:06 pm
Posts: 10
It could be bacause of datatype mismatch. I had this problem before. I had an attribute in Class A defined as 'short' but was reading it as Integer.

So hibernate was doing a dirty check and thought that the values have been changed after it was loaded and hence flushing it back to the database.

Hope this helps

_________________
Lachu

don't forget the credit system ;-)


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.