-->
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.  [ 5 posts ] 
Author Message
 Post subject: Update works (junit test) but not persisted in database
PostPosted: Mon Aug 23, 2004 6:33 am 
Newbie

Joined: Mon Dec 22, 2003 4:49 am
Posts: 16
I have the following problem:
From the one moment on the other my updates and removes on my classes stopped to work. The strange thing is that it still works when I run my unit test -> update + get + check + remove + get + check. So in my junit tests everything seems ok, but when I look at my db only the inserts are done (also only the insert qsl statements are printed in the log).

So, anybody an idea what is ging wrong here?

Grtz

Maarten

<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class
name="domain.InvolvedParty"
table="involved_party"
dynamic-update="false"
dynamic-insert="false"
>

<id
name="id"
column="id"
type="long"
unsaved-value="-1"
>
<generator class="native">
</generator>
</id>

<bag
name="involvedRoles"
lazy="false"
inverse="true"
cascade="all-delete-orphan"
>

<key
column="INVOLVED_PARTY_ID"
>
</key>

<one-to-many
class="domain.InvolvedRole"
/>
</bag>

<property
name="firstName"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="FIRST_NAME"
/>

<property
name="lastName"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="LAST_NAME"
/>

<bag
name="involvedPartyRelations"
lazy="false"
inverse="true"
cascade="all"
>

<key
column="RELATION_ID"
>
</key>

<one-to-many
class="domain.InvolvedParty"
/>
</bag>

<many-to-one
name="involvedPartyRelation"
class="domain.InvolvedParty"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="RELATION_ID"
not-null="false"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-InvolvedParty.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 7:01 am 
Newbie

Joined: Fri Aug 20, 2004 9:07 am
Posts: 8
dans hibernate, si vous faite un ensemble d'operation dans une session et vous avez une operation d'insertion ou de update et une selection par exemple, l'insertion ou le update se fait en premier lieu en local c-a-d chez hibernat et non pas sur le disque , lorsque tu fait selest sur ce que vous avez insere, il vous les envoi a partir du cache local et non pas a partir du disque , et a la fin des operation il fait un 'flush' de l'nsemble des operation et envoi la transaction vers JDBC, donc JDBC va faire le insert sans faire la selection


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 7:34 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
this is an english forum...

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: :)
PostPosted: Mon Aug 23, 2004 7:38 am 
Newbie

Joined: Mon Dec 22, 2003 4:49 am
Posts: 16
But the strange thing is that before the updates worked, the inserts are still persisted, but now indeed everything seems to be happening in memory or so?

So I'm very sure my unit test is correct and that the session is flushed, but still the data is not persisted.

......


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 23, 2004 7:54 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
it seems there is a problem in your session management, are you sure the committed session is the same as the flushed session?
You may have many unmanaged session

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.