Hi everyone, I have come across the following problem: Some properties on my POCO classes are very special: They are heavily updated (more specifically, they usually are the number of clicks on a link). In order to save trips to the DB, I keep the surplus of visits in memory for a while before updating. To ensure correctness of my app all around I also created a custom IUserType that has its NullSafeGet method return the sum of the value that was saved in the DB with the surplus value stored in memory (this way I can use NHibernate anywhere in my code to fetch these objects correctly).
The problem now is: When I want to update these objects, I have to make them dirty, but how is that possible if the value of the property is the value to be stored? I have tried silly stuff like: myPocoObject.visits++; myPocoObject.visits--; But it has not worked (I would also like to avoid that kind of hack). Is there a better way of doing this, other than implementing a custom type for every property that suffers of this problem? And if someone can help me on this as well, I would appreciate a better idea to do mass updates with NHibernate without fetching the objects first, or some reading material on it. Thanks in advance, -- Marcelo Zabani -- 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.
