Monday, March 09, 2009 7:04 PM
I am using WCF with Sql Server. i wrote a TSQL to create a CURSOR, populated with a SELECT. this is executed from the client, leaving the connection open. The client then executes a FETCH to retrieve records, but the connection is closed. Any ideas how to keep the connection open would be apprecaited.
Monday, March 09, 2009 8:04 PM
First off, you really, really, really don't want to do this. Leaving a connection open from the client will end up causing you to run out of connections since there are a limited number.
Monday, March 09, 2009 8:10 PM
so in your opinion, i should not create a cursor, but execute a new query for each page down and page up? when one searches say google, does it not keep a server cursor to page through the results?
Monday, March 09, 2009 8:20 PM
No, they do not keep any cursors open at Google (they probably don't use cursors actually).
Take a look at this paging article here, probably a step in the right direction.
Monday, March 09, 2009 11:16 PM
yeah, had considered that architecture. there are a couple of problems there. first, it creates a new query with each server hit. second, if data changes inbetween queries, the results change. a cursor would be perfect, this is exactly what it is for. if somehow the connection could be maintained on the server, and the client reconnect to it, or something.
the problem with the WCF forum is many features available in other platforms are not available in SIlverlight, so for Silverlight applications I prefer to stay here. but i do appreciate the suggestions.