-->
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.  [ 3 posts ] 
Author Message
 Post subject: Row was updated or deleted by another transaction
PostPosted: Fri May 19, 2006 11:35 am 
Newbie

Joined: Sat Sep 03, 2005 1:52 am
Posts: 8
Hey

This is the problem:
From the same webpage I can update or insert data from an instance of my VZInfotext - class.
When I update: no problem.
When I try to insert I get this exception: NHibernate.StaleObjectStateException: Row was updated or deleted by another transaction for NordicSolutionCenter.Model.VZInfotext instance with identifier: -1.
I have read all I can find about this exception. I have checked my mappings and so forth. I have deleted all database triggers for this class because I have experienced before that they can cause similar problems.
I do the same operation with lots of other classes without problems, so it is difficult to understand exactly what the problem is. Except that I can see that the transaction tries to save the same instance twice.
The VZInfotext mapping is below here first. After that I have written the part of the debug log that is written when I try to save a new VZInfotext.

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="NordicSolutionCenter.Model.VZInfotext, NordicSolutionCenter.Model" table="VZInfotext">
<id name="ID" column="ID" type="Int32" unsaved-value="-1">
<generator class="identity" />
</id>
<version name="Version" column="Version" type="Int32" unsaved-value="-1" />
<property name="Name" column="Name" />
<property name="Number" column="Number" />
<property name="IsLongText" column="IsLongText" />
<property name="Startdate" column="Startdate" type="DateTime" />
<property name="Enddate" column="Enddate" type="DateTime" />
<property name="Timestamp" column="Timestamp" update="false" insert="false" />
<many-to-one name="VZInfotextType"
class="NordicSolutionCenter.Model.VZInfotextType, NordicSolutionCenter.Model"
column="VZInfotextTypeID" />
<bag name="VZInfotext_TextList" lazy="true">
<key column="VZInfotextID"/>
<one-to-many class="NordicSolutionCenter.Model.VZInfotext_Text, NordicSolutionCenter.Model"/>
</bag>
</class>
</hibernate-mapping>


Log:

2006-05-19 16:46:20,062 [3176] DEBUG NHibernate.Transaction.AdoTransaction [(null)] <(null)> - begin
2006-05-19 16:46:20,062 [3176] DEBUG NHibernate.Engine.Cascades [(null)] <(null)> - unsaved-value: -1
2006-05-19 16:46:20,062 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - SaveOrUpdate() previously saved instance with id: -1
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - updating [NordicSolutionCenter.Model.VZInfotext#-1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - collection dereferenced while transient [NordicSolutionCenter.Model.VZInfotext.VZInfotext_TextList#-1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Transaction.AdoTransaction [(null)] <(null)> - commit
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - flushing session
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Flushing entities and processing referenced collections
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Language.Company_LanguageList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Language.Company_LanguageList#1], was: [NordicSolutionCenter.Model.Language.Company_LanguageList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Language.Language_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Language.Language_TextList#1], was: [NordicSolutionCenter.Model.Language.Language_TextList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_TextList#2], was: [NordicSolutionCenter.Model.Company.Company_TextList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_EContactInfoList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_EContactInfoList#2], was: [NordicSolutionCenter.Model.Company.Company_EContactInfoList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.CompanyList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.CompanyList#2], was: [NordicSolutionCenter.Model.Company.CompanyList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_LanguageList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_LanguageList#2], was: [NordicSolutionCenter.Model.Company.Company_LanguageList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.User_CompanyList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.User_CompanyList#2], was: [NordicSolutionCenter.Model.Company.User_CompanyList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_CompanyRoleList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_CompanyRoleList#2], was: [NordicSolutionCenter.Model.Company.Company_CompanyRoleList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_TextList#1], was: [NordicSolutionCenter.Model.Company.Company_TextList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_EContactInfoList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_EContactInfoList#1], was: [NordicSolutionCenter.Model.Company.Company_EContactInfoList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.CompanyList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.CompanyList#1], was: [NordicSolutionCenter.Model.Company.CompanyList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_LanguageList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_LanguageList#1], was: [NordicSolutionCenter.Model.Company.Company_LanguageList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.User_CompanyList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.User_CompanyList#1], was: [NordicSolutionCenter.Model.Company.User_CompanyList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Company.Company_CompanyRoleList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Company.Company_CompanyRoleList#1], was: [NordicSolutionCenter.Model.Company.Company_CompanyRoleList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.CRegion.CRegion_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.CRegion.CRegion_TextList#3], was: [NordicSolutionCenter.Model.CRegion.CRegion_TextList#3]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.CRegion.CRegion_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.CRegion.CRegion_TextList#2], was: [NordicSolutionCenter.Model.CRegion.CRegion_TextList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.CRegion.CRegion_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.CRegion.CRegion_TextList#1], was: [NordicSolutionCenter.Model.CRegion.CRegion_TextList#1]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Language.Company_LanguageList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Language.Company_LanguageList#2], was: [NordicSolutionCenter.Model.Language.Company_LanguageList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.Language.Language_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.Language.Language_TextList#2], was: [NordicSolutionCenter.Model.Language.Language_TextList#2]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZASystemText.VZASystemText_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZASystemText.VZASystemText_TextList#21], was: [NordicSolutionCenter.Model.VZASystemText.VZASystemText_TextList#21]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZASystemText.VZASystemText_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZASystemText.VZASystemText_TextList#22], was: [NordicSolutionCenter.Model.VZASystemText.VZASystemText_TextList#22]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZSystempart.VZSystempartInfotextTypeList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZSystempart.VZSystempartInfotextTypeList#3], was: [NordicSolutionCenter.Model.VZSystempart.VZSystempartInfotextTypeList#3]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZSystempart.VZSystempart_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZSystempart.VZSystempart_TextList#3], was: [NordicSolutionCenter.Model.VZSystempart.VZSystempart_TextList#3]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZSystempart.VZSystempartPictureTypeList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZSystempart.VZSystempartPictureTypeList#3], was: [NordicSolutionCenter.Model.VZSystempart.VZSystempartPictureTypeList#3]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZInfotextType.VZInfotextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZInfotextType.VZInfotextList#3], was: [NordicSolutionCenter.Model.VZInfotextType.VZInfotextList#3]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZInfotextType.VZInfotextTypePictureTypeList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZInfotextType.VZInfotextTypePictureTypeList#3], was: [NordicSolutionCenter.Model.VZInfotextType.VZInfotextTypePictureTypeList#3]
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZInfotextType.VZInfotextType_TextList
2006-05-19 16:46:20,078 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZInfotextType.VZInfotextType_TextList#3], was: [NordicSolutionCenter.Model.VZInfotextType.VZInfotextType_TextList#3]
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.WrapVisitor [(null)] <(null)> - Wrapped collection in role: NordicSolutionCenter.Model.VZInfotext.VZInfotext_TextList
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Updating entity: [NordicSolutionCenter.Model.VZInfotext#-1]
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Engine.Versioning [(null)] <(null)> - Incrementing: 0 to 1
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.AbstractVisitor [(null)] <(null)> - Processing collection for role NordicSolutionCenter.Model.VZInfotext.VZInfotext_TextList
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Collection found: [NordicSolutionCenter.Model.VZInfotext.VZInfotext_TextList#-1], was: [<unreferenced>]
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Processing unreferenced collections
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - scheduling collection removes/(re)creates/updates
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Flushed: 0 insertions, 1 updates, 0 deletions to 20 objects
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - Flushed: 1 (re)creations, 0 updates, 1 removals to 28 collections
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - listing entities:
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.Company_Language{IsDefaultLanguage=False, IsAdministrationLanguage=True, ID=4, Timestamp=15-03-2006, IsActiveOnWeb=True, Version=0, Language=Language#2, Number=2, Company=Company#2, IsDefaultAdministrationLanguage=False}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.Company_Language{IsDefaultLanguage=True, IsAdministrationLanguage=True, ID=3, Timestamp=15-03-2006, IsActiveOnWeb=True, Version=0, Language=Language#1, Number=1, Company=Company#2, IsDefaultAdministrationLanguage=True}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZSetting{Version=0, Name=CultureCode, SValue=da-DK, ID=1, Timestamp=17-05-2006}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZASystemText{Version=0, Name=NameMandatoryMessage, Timestamp=18-05-2006, VZASystemText_TextList=[VZASystemText_Text#43, VZASystemText_Text#44], ID=22, Type=Error}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZInfotextType{VZInfotextType_TextList=uninitialized, VZInfotextList=uninitialized, ID=3, VZSystempart=VZSystempart#3, Timestamp=15-05-2006, Name=CWMainInfoText1, VZInfotextTypePictureTypeList=uninitialized, Version=0}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZASystemText_Text{Version=0, Text=Name must be filled out!, ID=44, VZASystemText=VZASystemText#22, Timestamp=18-05-2006, TextLanguage=Language#2}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.CRegion{Version=0, Name=Jutland, ParentCRegion=CRegion#2, ID=3, Timestamp=15-03-2006, CRegion_TextList=uninitialized}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.CRegion{Version=0, Name=Denmark, ParentCRegion=CRegion#1, ID=2, Timestamp=15-03-2006, CRegion_TextList=uninitialized}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.CRegion{Version=0, Name=Europa, ParentCRegion=null, ID=1, Timestamp=15-03-2006, CRegion_TextList=uninitialized}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZASystemText{Version=0, Name=InvalidDateMessage, Timestamp=18-05-2006, VZASystemText_TextList=[VZASystemText_Text#41, VZASystemText_Text#42], ID=21, Type=Error}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZASystemText_Text{Version=0, Text=Navn skal udfyldes!, ID=43, VZASystemText=VZASystemText#22, Timestamp=18-05-2006, TextLanguage=Language#1}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.Company{ParentCompany=Company#1, Name=Nordic Solution Center, ID=2, YPosition=0, XPosition=0, Company_TextList=uninitialized, Company_EContactInfoList=uninitialized, CompanyList=uninitialized, Company_LanguageList=[Company_Language#3, Company_Language#4], Timestamp=15-03-2006, CRegion=CRegion#3, Version=1, User_CompanyList=uninitialized, Active=True, Company_CompanyRoleList=uninitialized}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.Company{ParentCompany=null, Name=Vesterzone, ID=1, YPosition=0, XPosition=0, Company_TextList=uninitialized, Company_EContactInfoList=uninitialized, CompanyList=uninitialized, Company_LanguageList=uninitialized, Timestamp=15-03-2006, CRegion=CRegion#3, Version=1, User_CompanyList=uninitialized, Active=True, Company_CompanyRoleList=uninitialized}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZInfotext{Name=test, ID=-1, IsLongText=False, Enddate=null, Startdate=null, Timestamp=01-01-0001, Version=1, VZInfotext_TextList=[], VZInfotextType=VZInfotextType#3, Number=0}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZASystemText_Text{Version=0, Text=Invalid date!, ID=42, VZASystemText=VZASystemText#21, Timestamp=18-05-2006, TextLanguage=Language#2}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZASystemText_Text{Version=0, Text=Ugyldig dato!, ID=41, VZASystemText=VZASystemText#21, Timestamp=18-05-2006, TextLanguage=Language#1}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZSystempart{Version=0, Name=CWMain.aspx, VZSystempartInfotextTypeList=uninitialized, VZSystempart_TextList=uninitialized, VZSystempartPictureTypeList=uninitialized, ID=3, Timestamp=15-05-2006}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.VZSession{LastUrl=http://localhost/NordicSolutionCenterWeb/Default.aspx, ID=161, FinishTimestamp=19-05-2006, SessionID=o0tqv1nojtuxom55cxt21gng, UserID=1, IsSessionLogOn=False, Timestamp=19-05-2006, Version=2, Language=Language#1, IsUserImpersonator=False, Company=Company#2}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.Language{Version=0, Language_TextList=uninitialized, Name=English, Code=en , Company_LanguageList=uninitialized, ID=2, Timestamp=11-02-2005}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.Printer [(null)] <(null)> - NordicSolutionCenter.Model.Language{Version=0, Language_TextList=uninitialized, Name=Dansk, Code=da , Company_LanguageList=uninitialized, ID=1, Timestamp=11-02-2005}
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - executing flush
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Persister.EntityPersister [(null)] <(null)> - Updating entity: [NordicSolutionCenter.Model.VZInfotext#-1]
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Persister.EntityPersister [(null)] <(null)> - Existing version: 0 -> New Version: 1
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Opened new IDbCommand, open IDbCommands :1
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Building an IDbCommand object for the SqlString: UPDATE VZInfotext SET Name = :Name, IsLongText = :IsLongText, Enddate = :Enddate, Startdate = :Startdate, Version = :Version, Number = :Number, VZInfotextTypeID = :VZInfotextTypeID WHERE ID = :ID AND Version = :Version
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Persister.EntityPersister [(null)] <(null)> - Dehydrating entity: [NordicSolutionCenter.Model.VZInfotext#-1]
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.StringType [(null)] <(null)> - binding 'test' to parameter: 0
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.BooleanType [(null)] <(null)> - binding 'False' to parameter: 1
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.DateTimeType [(null)] <(null)> - binding null to parameter: 2
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.DateTimeType [(null)] <(null)> - binding null to parameter: 3
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.Int32Type [(null)] <(null)> - binding '1' to parameter: 4
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.Int32Type [(null)] <(null)> - binding '0' to parameter: 5
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.Int32Type [(null)] <(null)> - binding '3' to parameter: 6
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.Int32Type [(null)] <(null)> - binding '-1' to parameter: 7
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.Type.Int32Type [(null)] <(null)> - binding '0' to parameter: 8
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - UPDATE VZInfotext SET Name = @p0, IsLongText = @p1, Enddate = @p2, Startdate = @p3, Version = @p4, Number = @p5, VZInfotextTypeID = @p6 WHERE ID = @p7 AND Version = @p8
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p0 = 'test'
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p1 = 'False'
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p2 = ''
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p3 = ''
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p4 = '1'
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p5 = '0'
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p6 = '3'
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p7 = '-1'
2006-05-19 16:46:20,093 [3176] DEBUG NHibernate.SQL [(null)] <(null)> - @p8 = '0'
2006-05-19 16:46:20,109 [3176] ERROR NHibernate.StaleObjectStateException [(null)] <(null)> - An operation failed due to stale data
NHibernate.StaleObjectStateException: Row was updated or deleted by another transaction for NordicSolutionCenter.Model.VZInfotext instance with identifier: -1
2006-05-19 16:46:20,156 [3176] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Closed IDbCommand, open IDbCommands :0
2006-05-19 16:46:20,156 [3176] ERROR NHibernate.Impl.SessionImpl [(null)] <(null)> - could not synchronize database state with session
NHibernate.StaleObjectStateException: Row was updated or deleted by another transaction for NordicSolutionCenter.Model.VZInfotext instance with identifier: -1
at NHibernate.Persister.AbstractEntityPersister.Check(Int32 rows, Object id)
at NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Boolean[] includeProperty, Object oldVersion, Object obj, SqlString sqlUpdateString, ISessionImplementor session)
at NHibernate.Persister.EntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Object[] oldFields, Object oldVersion, Object obj, ISessionImplementor session)
at NHibernate.Impl.ScheduledUpdate.Execute()
at NHibernate.Impl.SessionImpl.Execute(IExecutable executable)
at NHibernate.Impl.SessionImpl.ExecuteAll(IList list)
at NHibernate.Impl.SessionImpl.Execute()
2006-05-19 16:46:20,171 [3176] DEBUG NHibernate.Transaction.AdoTransaction [(null)] <(null)> - rollback
2006-05-19 16:46:20,171 [3176] DEBUG NHibernate.Transaction.AdoTransaction [(null)] <(null)> - running AdoTransaction.Dispose()
2006-05-19 16:46:20,171 [3176] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - transaction completion


Top
 Profile  
 
 Post subject: Re: Row was updated or deleted by another transaction
PostPosted: Fri May 19, 2006 11:41 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
jorgenvester wrote:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class  name="NordicSolutionCenter.Model.VZInfotext, NordicSolutionCenter.Model" table="VZInfotext">
    <id name="ID" column="ID" type="Int32" unsaved-value="-1">
       <generator class="identity" />
    </id>
    <version name="Version" column="Version" type="Int32" unsaved-value="-1" />



What is value of Version property at the time of saving new object? 0 or -1? It must be -1, to be correct for Your mapping file.

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject: How could I overlook that!
PostPosted: Fri May 19, 2006 12:44 pm 
Newbie

Joined: Sat Sep 03, 2005 1:52 am
Posts: 8
Hey gert!

thank you!! I have worked so long with NHibernate that I did not think about that possiblity because I just copy classes and mapping files when I need new ones and then correct them afterwards. This detail is something trivial that normally is OK. I have some classes where I until now have put values straight into the database and only used NHibenate to read data. Because of this this error have existed very long in some classes and now you helped me to find it. Again thanks!!


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