Asked By Brandon Schave
09-Feb-12 06:12 PM

I have a fairly large object that also has a fairly large object within it. among other small objects like a user object, etc. I carry this object in a session. The page for this object is used in order to buy product in options per contract.
functionality on the page...
the functionality is the user comes in to a contract by default (alphabetically set up) and then chooses what products he wants to buy. Then the user buys the product for that day. The user can then either go to another day in the future by pressing the "next day" button to by product for that days as well. The user can do this for as many days out as they want. The user may also be able to go to the next contract by pressing on the "next contract" button. so the user goes through each contract, buys product for as many days out that they wants and then go to the next contract until they have made all of there purchases.
what my code does....
when i load the page for the first time, I instantiate the object, use the object and save data in it and then I put it in a session variable to keep the data that I need to know which contract I need to go to next. When the page reloads...not postback, I check to see if the session variable is null. If the session variable is not null, then i make the object equal to the session variable and use the object and data and then I save the object again in the session variable.
the problem...
The problem is that when I go through 7-20 days in the future, I get the error "object reference not set to an instance of an object" within the product object that is stored in the session. The weird thing is that this error is given on diferent days depending on the contract, but it always eventually errors out. I have noticed that if the contract has less data in it, I can go through more days before I get the error. If I go through a contract with more data, I can go through less days before I get the error.
Does anyone know why this is happening? I have tried to recreate this issue on my local in debug mode, but I never get the errors.