in addition (and contrary to the above behavior) I'm seeing that if I load a given Ticket, then add a Note to it, then re-query for the Ticket .. the entire Ticket is loaded from the cache, WITHOUT the new note.
What am I doing wrong? On Jun 3, 1:48 pm, fel0niousmonk <[email protected]> wrote: > Everything I've read would lead me to believe that what I'm seeing > shouldn't happen, but alas it is, and I don't know why, or if it's > 'fixable'. > > Suppose I have the following entities: > > - Customer > - Ticket > -- IList<Note> > -- IList<Reminder> > > I have a query that returns all Tickets for a given CustomerID. > - The first time, this loads up everything from the database as > expected. > - If I call this again, everything is loaded from cache as expected, > including children > - If I add a new ticket, then re-query, I get: > -- Select * from Tickets where Customer_Id = 1234 > -- select * from Notes where Ticket_Id = 6789 > -- select * from Reminders where Ticket_Id = 6789 > -- select * from Notes where Ticket_Id = 7890 > -- select * from Reminders where Ticket_Id = 7890 > > At first, I thought the first line was expected. NHibernate knows I > added a new ticket for that customer, so it knows the previous list of > ticket ids in the cache is outdated. > -- However, now that I'm thinking about it, if it knows to re-query > because a new ticket was added, why does it need to re-query for the > list of tickets? > -- Secondly why would NHibernate need to re-query for the ticket's > child entities which were already in the cache? For that matter, why > does it need to re-query for the tickets which were already in the > cache? -- 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.
