Hi,
I'm having trouble saving a huge entity to a database. Imagine its an order with orderlines. My order has 700 order lines.
I'm not saving the orderlines through cascading. I'm forcing the Session.SaveOrUpdate for each orderline due to some business logic reasons. For each orderline i'm using a criteria with a .Max projection to get a value I need. The second time this criteria runs it hangs out for minutes, so i suspect it is trying to get a lock for the orderline table and it can't.
The strange thing is that i've got other orders with less lines, lets say 10, and it works perfectly. Also with the order that has 700 lines i see a lot of threads being created and destroyed, so i suspect this is nhibernate's doing. I just don't understand why it works with 10 orderlines and not with 700.
Has anyone had similar behavior? I'm going to test with 50 / 100 / 300, etc, orderlines to see if i discover anything interesting.
In the meanwhile, if someone has any clue on this, please share your thoughts.
Best regards, MF.
|