Invalidate disconected recodset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

We would like to use MS SQL Server Express database for out data. The data
can be updated by many clients.

There will be an application that will show these data. This application can
work with the disconnected recordest.

My question is, how to notify this application, about the data in recordset
are not valid anymore, because the table in the database had been changed by
a client?

As I understand, I can not use Notification Services with SQL Express.

1/ Is the trigger that would send message to the Service broker suitable for
this scenario?

2/ Can I use Event notification? I think they don’t work with DML

3/ What would be the best way to inform *.exe app that the disconnected
recodset is not valid?

Thanks for any ideas.

Lubomir
 
Query Notification can detect changes in the dataset a client is interested:
http://msdn2.microsoft.com/en-us/library/t9x04ed2.aspx
The clients can use the ADO.Net wrappers: SqlNotifications or SqlDependency.

How many clients are we talking about? SqlDependency keeps a connection open
blocked in a WAITFOR(RECEIVE), therefore cosnsumming a thread on the server,
for each appdomain that called SqlDendency.Start(), so this cannot scale
high (hundreds of clients), but since you say is SQL Express, probably
you're scale is small to start with.

HTH,
~ Remus
 
There will be much more clients probably. We can not leave connecitons open.
However, the there will not be many transmitted data.
 
If the updates of the data are rare, you can subscribe to query notification
w/o using SQL Dependency. Clients can check each time they connect if a
notification was sent, and if so they need to update the dataset.
That being said, a SQL Express instance wiht 'much more' than hudrends of
clients is not gonna work for many other reasons (CPU scheduler limitations,
database sizes etc etc), as even if clients connect seldom, there will be
spikes when many clients want to connect and the SQL Express will not be
able to handle them.
 
Yes, my mistake. I was speaking about DataSet.

I had a look at the SQLDependency, but I can't find any description about
how to use in Windows Application. In all articles I read this class were use
with ASP.NET

I found a note, that it can be use in 2 scenarios:
pushing (Service Broker is involved)
polling (triggers are involved)

Unfortunatelly, again, I didn't find any more details.

Where coudl I find more information about using these scenerios in Windows
(Non Internet) app?
Thanks,

Lubomir
 
Back
Top