-->
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: "SQL insert, update or delete failed" error
PostPosted: Fri Nov 10, 2006 9:47 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
Hello everybody,

I need some help with NHibernate here. I have an experience with Hibernate (for java) but now ( in .NET) I'm experiencing trouble that I'm not being able to solve :s

When I try to save some classes (using save, saveorupdate, saveorupdatecopy) I get the following error message:

Code:
SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.


I looked for it in google and I found things related to sets in mappings. Like when you try to persist a children class without its parent. But I do not have this case in my mapping.

Here goes some of the mappings of classes that give me the error:

Quote:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="SGEIntegracao.Entidade.HistoricoAfericao, SGEIntegracao" table="T35_Historico_Afericao">

<composite-id>
<key-property name="NumeroSerieProcessador" column="T35_Numero_Serie_Processador" type="String" />
<key-property name="Faixa" column="T35_Faixa" type="String" />
<key-property name="DataAfericao" column="T35_Data_Afericao" type="DateTime" />
<key-property name="TipoAfericao" column="T35_Tipo_Afericao" type="Int32" />
</composite-id>

<property name="DataValidade" column="T35_Data_Validade" type="DateTime" />
<property name="Inmetro" column="T35_Inmetro" type="String" />
<property name="LacreInmetro" column="T35_Numero_Serie_Inmetro" type="String" />
<property name="NumeroSerieInmetro" column="T35_Lacre_Inmetro" type="String" />

</class>
</hibernate-mapping>



Quote:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="SGEIntegracao.Entidade.Equi, SGEIntegracao" table="TBEQUI">

<id name="ID" column="EQUI_ID" type="String">
<generator class="assigned"/>
</id>

<property name="Nome" column="Nome" type="String" />
<property name="Observacao" column="Obse" type="String" />
<property name="Fabricante" column="Fabr" type="String" />
<property name="Modelo" column="Mode" type="String" />
<property name="Tipo" column="Tipo" type="String" />

</class>
</hibernate-mapping>



For other classes persisted in the same session, everything works fine. I'm using the same session because I need to use the same transaction for many persistences.



Anything you could do for me? thanks




Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

_________________
Don't forget to rate if the post helped!


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.