开发者

Does WCF cache stored procedures

I have a WCF service that my client makes a call to telling it to run storedprocedure1, with param1, param2, etc.

When the WCF service gets this call, it instantiates a class that instantiates a DAO class. The DA开发者_StackOverflowO class creates the connection, loads the parameters into a SqlCommand object, then executes the object.

After finishing, it closes the SqlConnection, but does not close or dispose the DAO class, because there are multiple procedures it needs to run.

Here's the problem. If I edit storedprocedure1 and then call it through the WCF service, the changes I made in storedprocedure1 are not reflected until I restart the WCF service. Its like the storedprocedure1 is cached in WCF.

Has anyone else experienced this and is there a solution?


I think the WCF service is caching the results of the stored procedure.

See this: http://msdn.microsoft.com/en-us/library/ee230443.aspx


I think the key likely lies in this statement:

but does not close or dispose the DAO class

Without seeing the code for your DAO class it's hard to say, but it seems more likely that the query result is being cached by your data access layer than it does that it's being cached by WCF.

Either way, it really has nothing to do with the stored procedure, it's just caching the result of executing the stored procedure. If you changed the data instead of changing the procedure, the same problem should exist - you get back stale data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜