Hi,
How do people handle parent/child relationships for C.R.U.D situations in a client/server application using .net remoting that deals with parents that have large collections? For examples sake lets just say it is an Category --> Item relationship.
I'm using NHibernate for an ORM. While the read performance is acceptable update, insert and delete are not.
My understanding as to why performance is poor is because the DAO on the server hands the client a copy (serialized) of the object. As a result any change to the objects state isn't reflected on the server and thus the ISession isn't aware of it. Therefore when I go to save the object NHibernate generates SQL statements for every item in the collection.
A couple of possible solutions come to mind,
* Remove the collection from parent and set the parent of the supposed child in some "Manager" service that accesses DAO on the server.
* Making the collection items responsible for knowing whether they're dirty and persist one-by-one accordingly. Perhaps I can plug this into Nhibernate somewhere?
Other options?
Cheers,
Aeden
|