I am trying to figure out how to communicate to some web clients when a
SQL Server table has changed. I am connecting to the database through
ADO embedded on the clients in web pages. I want to be able to refresh
data on the client only when needed. I have researched all sorts of
methodologies and it seams like the CREATE_ENDPOINT will allow for me
to create a connection where I can call some functions like;
getDataStatus and return to the client what date time the data last
changed and then allow my client to requery the database or, something
like, setAccessTime where the Client sends its last date time stamp
when It last queried for data and allow the server to send back the
requested dataset to the client.Synchronize clock, sync up the clocks
of the clients to server.
Any help would be greatly appreciated. DanHello Dan,
I don't think there's a great way to do this since Web Services is essential
ly
a pull rather than push approach. If you were working with traditional ASMX
functions, I'd suggest looking at SqlCacheDependency since that could "subsc
ribe"
to changes on a query without having to invest a lot in the infrastructure
of the solution. Your ASMX would cache the dataset (saving SQL Server genera
ting
it fresh or from cache) and would, more or less, automatically get updated
data whenever your query changed. You could then add your bits for tracking
when the last change was received.
There really shouldn't need to be a have the client do more periodically
"call home" and ask "have you got a new version of this data?" Use some seri
al
number approach instead of time so that you don't have to worry about timezo
ne
changes between the client and the server.
This probably works "better" in that it minimizes the load on SQL Server
and gives you a better programability model than just a native web service
does today. Not saying that these services aren't useful, but they are harde
r
to use concepts like SqlDepedency on.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Thanks, I think I understand what you are getting at. There are no real
provisions to push to clients any data without request from the client
unless you take advantage of new .net technology which will allow for
caching of data on querys, tables etc... and automatically update the
data every ' as set up within the SQL or is it web config. Anyway. I
think I may have my clients poll for a serial number from an END_POINT
and then get the data when the serial number is different from the
clients. Do you think this will work. I wasn't sure if you were saying
it would or would not work? Thanks.|||Hello Dan,
> Thanks, I think I understand what you are getting at. There are no
> real provisions to push to clients any data without request from the
> client unless you take advantage of new .net technology which will
> allow for caching of data on querys, tables etc... and automatically
> update the data every '
There a new set of features in SQL Server 2005, .NET 2.0 and ASP.NET 2.0
allow a client to subscriber to notifications of changes on the data underly
ing
a query. In .NET, its common to use SqlDependency for this. In ASP.NET 2.0,
its common to use SqlCacheDependency. These subscribe to server-side events
and allow processing of them on the client side. However, they currently
require an active TDS connection to SQL Server.
When you get the notification, you can then decide what you want to do. A
common choice is to recall your loading code and restart the dependency.
> as set up within the SQL or is it web config.
Some of both. Google on SqlCacheDependency for more information.
> Anyway. I think I may have my clients poll for a serial number from an
> END_POINT and then get the data when the serial number is different
> from the clients. Do you think this will work. I wasn't sure if you
> were saying it would or would not work? Thanks.
No, because the endpoint doesn't have a good way to keep track of a serial
number. I'm basically suggesting that if you want an optimized solution (in
this case), don't use endpoints, use ASMX instead.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Thank You, Ill look into it. Dan
Friday, February 17, 2012
CREATE_ENDPOINT / HTTPRequest
Labels:
asql,
clients,
communicate,
connecting,
create_endpoint,
database,
figure,
httprequest,
microsoft,
mysql,
oracle,
server,
sql,
table,
throughado,
web
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment