Technical advice needed regarding polling the database

N

Nadia Amir

I have a database which is very frequently updated .I want an option that
user can specify that after how many minutes he/she wants to see those
changes . Like a mechanism which would do



1.. Poll database after a user defined period and then bring those changes
,mean while displaying the stale data (like Cache )
2.. Also allow user to choose if he/she wants to see/notify updates as
they come
3.. Can notify change ( if any ) in a particular table occur


I have read a lot about SQLDependency class which is used to data caching
..The reason I am confused is



1. The recommendations are that don't use this feature if your data is
frequently updating (in my case data is frequently updating)

2. The class does Cache data for me but I cant find any mechanism which
would notify me that a change has occurred and how many row in a particular
table are added.



I am confused .What feature I should used . Should SQLDependency class can
do the things I want or these can be done without SQLDependency Cache
feature .



Please advice.



Thanks in advance
 
E

Eliyahu Goldin

I assume you are talking about an asp.net application and the user keeps the
application open in a browser window all the time.

I would introduce a client-side timer that would make an ajax call once in
the preset period to get updates from the server side. The server side would
response with the refreshed database records plus some info on what has been
changed. Based on this info the client side code can notify the user on the
changes.

You can store user's choice for the refresh interval and options in browser
cookies that they will be restored next time when the user opens the
application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top