Here’s the problem I’m running into. I’m using MS SQL 2005 and Castle
ActiveRecord with NHibernate 2.0.0.1001. I added a varbinary(max)
column to my database so that I can store a Serializable object. I
added a property to my ActiveRecord entity as follows:
[Property(ColumnType = "Serializable")]
public PortletConfiguration StateObject
{
get { return stateObject; }
set { stateObject = value; }
}
My PortletConfiguration type (mentioned above) is Serializable.
NHibernate is correctly storing and retrieving the data perfectly.
There does not appear to be any problem with serializing or
deserializing the entity to/from the database.
The problem is, any time I select data from my table, I notice that
NHibernate runs UPDATE commands when the session ends (auto-flush at
end of session). This UPDATE command is run in SQL even though I have
not made any changes to my entity (i.e. no data has been changed). It
appears that NHibernate is incorrectly flagging the entity as modified
and is trying to persist the "changes."
I have isolated the problem to this single column. By removing this
column from my entity, the mysterious UPDATE commands no longer
occur. Do you have any suggestions? I'm really stuck. Any help
would be greatly appreciated. Thank you so much!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---