I have a .Net server application backed by a SQL server DB. I’m using nHibernate (fluent) to handle all the DB operations. I’m facing serious performance and concurrency issues, obviously deriving from the fact that I’m not an expert (not even close) on nHibernate and ORMs in general.
I have some data that needs to be stored in the DB and some data that doesn’t. For example, I have the members class (which obviously needs to be persisted in the DB) and I also have the logged-in-members class (which only holds runtime data and which doesn’t need to be persisted). Maybe my example is not the best, but I think it demonstrates what my situation is. A logged-in-member object will have a property of type Member so that there is a connection between the two classes.
Is there any way to avoid persisting some classes but still be able to have a complete graph, consisting of both persistent and “in-memory” objects?
I’m not sure how the object graph looks like but why not let the session figure out what changed?
Update: as response to the comment, something like this