Hi, this is a weird one ....
We have a large, live system that has been running fine for several years. We use remoting servers for the middle-tier, and they mainly do a lot of SQL Server access. We use typed datasets and ADO.NET data adapters to load data.
Our client uses a cluster of virtual machines to host the remoting servers.
Recently, a few weeks after we updated their live code and after a few weeks of apparently successful running, users started reporting constraint errors. The constraints appear when loading existing data from the database.
From our error logs it looks like NULLs are being returned for some non-null columns. The columns are non-null in the SQL Server schema and non-null in our typed datasets.
When loading data we generally turn off constraints in the dataset while we load and set them back on after the data is loaded -- this is where the constraint exceptions occur.
It is happening on several tables (the 'core' tables and thus the most frequently queried).
I have difficulty seeing how a field from the database with a non-null constraint can be read by ADO.NET as NULL.
Our error log also shows that some of the errors are NOT constraint errors, but invalid casts (as you get when accessing a null field through the typed dataset). This means that the NULL value in the non-null field is getting past constraint checking?
Even weirder, if the middle-tier remoting server is rebooted, the problem goes away (for a while, at least).
Anyone got any clues/suggestions/answers?
Herbie