N
Nick Gilbert
Hi,
I have a website which updates a value in a database and then
immediately requests a dataset which contains that value. Sometimes I
the data returned contains the OLD value even though the database itself
shows the correct value. Ie JET was sending back an out of date value
for the data.
Similarly, when updating, I occasionally get the following exception:
"The Microsoft Jet database engine stopped the process because you and
another user are attempting to change the same data at the same time. ".
It seems that if you immediately read back the data on the same
connection, it appears to be correct. But if, after updating the data,
you redirect to a webpage which should contain the updated data, then it
somehow can get OLD data. This happens even when the code is wrapped in
a transaction. I've proved that IIS isn't serving me an old *page* but
IS serving me old *data* by adding a sequential counter to the page (if
it was serving me an old page the counter would go backwards). So the
problem is definitely that Access (or it's drivers) is returning the old
values for some of the rows.
I presume what's happening is that if you redirect to a different page
after updating the database, you don't necessarily get the same thread
in IIS or the same connection from the connection pool, and somehow it's
managing to retrieve the old value from the database or perhaps some
caching is happening somewhere at IIS level.
Is there no way to force Access to properly flush all changes to the
database so this problem doesn't happen?
For information, connection pooling is enabled in my application for
performance reasons.
I really need to fix this problem ASAP. Any help would be greatly
appreciated.
Nick...
I have a website which updates a value in a database and then
immediately requests a dataset which contains that value. Sometimes I
the data returned contains the OLD value even though the database itself
shows the correct value. Ie JET was sending back an out of date value
for the data.
Similarly, when updating, I occasionally get the following exception:
"The Microsoft Jet database engine stopped the process because you and
another user are attempting to change the same data at the same time. ".
It seems that if you immediately read back the data on the same
connection, it appears to be correct. But if, after updating the data,
you redirect to a webpage which should contain the updated data, then it
somehow can get OLD data. This happens even when the code is wrapped in
a transaction. I've proved that IIS isn't serving me an old *page* but
IS serving me old *data* by adding a sequential counter to the page (if
it was serving me an old page the counter would go backwards). So the
problem is definitely that Access (or it's drivers) is returning the old
values for some of the rows.
I presume what's happening is that if you redirect to a different page
after updating the database, you don't necessarily get the same thread
in IIS or the same connection from the connection pool, and somehow it's
managing to retrieve the old value from the database or perhaps some
caching is happening somewhere at IIS level.
Is there no way to force Access to properly flush all changes to the
database so this problem doesn't happen?
For information, connection pooling is enabled in my application for
performance reasons.
I really need to fix this problem ASAP. Any help would be greatly
appreciated.
Nick...