if different threads are updating the same instance in the same time, you'll have problems. if the same entity isn't updated by different threads in the same time, you can use multiple sessions. If they are, then you gotta explain why and how you're doing so, because there are concurrency issues with this, because one thread is overriding the changed of another thread.
On Wed, Jul 21, 2010 at 10:20 PM, Giulio Petrucci <[email protected] > wrote: > Hi John, > > thanks for your reply. > > On Wed, Jul 21, 2010 at 8:13 PM, John Davidson <[email protected]> > wrote: > > It actually sounds as if a cache solution is what you require, but it is > > difficult to tell exactly from the problems you are encountering. What is > > the major use case for your application? > > What do you mean with "use case"? My application is a windows service, > periodically reading some data from a db (using NHibernate, of > course). The model is like this: > > class Matrix { > IEnumerable <Column> ColumnSet { get; } > IEnumerable <Row> RowSet { get; } > void AddColumn(Column c); > void AddRow(Row r); > } > > class Column > { > Matrix Matrix { ... } > String Label { ... } > } > > class Row > { > Matrix Matrix { ... } > IEnumerable<Element> ElementSet { get; } > String Label { ... } > } > > class Element { > Int32 Value { get; } > Row Row { get; } > Column Column { get; } > } > > so, my service every 10 minutes (for example), loads some Matrix > instances. Then for each column, iterates over all the elments and > perform some operation, calling a remote web service. Those > operations, which involve read/write access to the data layer, have to > be executed in a "parallel" way, so they're actually execute in > different threads. > > Don't know if I've actually answered your question, If not, please, > let me know. :-) > > Thanks again, > Giulio > > -- > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- 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.
