Syncing Database to Application (polling)Scheduling a task that happens very frequently in Sql ServerWhat...

Is there a way to find out the age of climbing ropes?

is 'sed' thread safe

What can I do if someone tampers with my SSH public key?

Was it really inappropriate to write a pull request for the company I interviewed with?

When was drinking water recognized as crucial in marathon running?

Are small insurances worth it

The Ohm's law calculations of the parts do not agree with the whole

Being asked to review a paper in conference one has submitted to

The need of reserving one's ability in job interviews

Can we carry rice to Japan?

PTIJ: Mordechai mourning

Giving a talk in my old university, how prominently should I tell students my salary?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Should we avoid writing fiction about historical events without extensive research?

Misplaced tyre lever - alternatives?

Is there any relevance to Thor getting his hair cut other than comedic value?

Is there a math equivalent to the conditional ternary operator?

Correct physics behind the colors on CD (compact disc)?

How can I handle a player who pre-plans arguments about my rulings on RAW?

Deal the cards to the players

Is every open circuit a capacitor?

If nine coins are tossed, what is the probability that the number of heads is even?

Quitting employee has privileged access to critical information

Book about a time-travel war fought by computers



Syncing Database to Application (polling)


Scheduling a task that happens very frequently in Sql ServerWhat does the wait type PREEMPTIVE_XE_CALLBACKEXECUTE mean?Creating an index on table A but with reference to table BMySQL rapid Data Replication from multiple DatabasesOccasional error shrinking transaction log filesSQL Server Database backup regressed to historical dateSQL 2016 SP1 Mirroring - slow database list refresh and repetitive automatic failoversSQL Server Connection Timeout IssueHow do you skip databases with Ola.Hallengren's scripts?Database enters in recovery mode every time the Transaction Log is full













0















I have created a windows application that uses a MS SQL 2008 database server.



There are two types of the application:



1) Client Application
2) Host Application



The client application is able to send commands to the database that the host application polls and performs the command,
e.g. restart host server, restart host appliation, host check for application updates, host show debugs etc.



Once the host application picks up the command from the database the command is removed. The client application has a command task list that shows the outstanding tasks. Currently to keep this task list up-to-date (e.g. to remove tasks that have been completed) I have to query/poll the database every 3 seconds to get a refreshed dataset for the client application.



Is there a better way to poll the database, I am not sure querying the databse every 3 seconds is a good idea even if the query is very small.



Is there a way for the database to tell the application to refresh if a table is updated?



Thanks, Greg










share|improve this question














bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Sounds like you might want to look at BizTalk. microsoft.com/en-us/server-cloud/products/biztalk

    – Dave
    Oct 5 '15 at 17:20
















0















I have created a windows application that uses a MS SQL 2008 database server.



There are two types of the application:



1) Client Application
2) Host Application



The client application is able to send commands to the database that the host application polls and performs the command,
e.g. restart host server, restart host appliation, host check for application updates, host show debugs etc.



Once the host application picks up the command from the database the command is removed. The client application has a command task list that shows the outstanding tasks. Currently to keep this task list up-to-date (e.g. to remove tasks that have been completed) I have to query/poll the database every 3 seconds to get a refreshed dataset for the client application.



Is there a better way to poll the database, I am not sure querying the databse every 3 seconds is a good idea even if the query is very small.



Is there a way for the database to tell the application to refresh if a table is updated?



Thanks, Greg










share|improve this question














bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Sounds like you might want to look at BizTalk. microsoft.com/en-us/server-cloud/products/biztalk

    – Dave
    Oct 5 '15 at 17:20














0












0








0








I have created a windows application that uses a MS SQL 2008 database server.



There are two types of the application:



1) Client Application
2) Host Application



The client application is able to send commands to the database that the host application polls and performs the command,
e.g. restart host server, restart host appliation, host check for application updates, host show debugs etc.



Once the host application picks up the command from the database the command is removed. The client application has a command task list that shows the outstanding tasks. Currently to keep this task list up-to-date (e.g. to remove tasks that have been completed) I have to query/poll the database every 3 seconds to get a refreshed dataset for the client application.



Is there a better way to poll the database, I am not sure querying the databse every 3 seconds is a good idea even if the query is very small.



Is there a way for the database to tell the application to refresh if a table is updated?



Thanks, Greg










share|improve this question














I have created a windows application that uses a MS SQL 2008 database server.



There are two types of the application:



1) Client Application
2) Host Application



The client application is able to send commands to the database that the host application polls and performs the command,
e.g. restart host server, restart host appliation, host check for application updates, host show debugs etc.



Once the host application picks up the command from the database the command is removed. The client application has a command task list that shows the outstanding tasks. Currently to keep this task list up-to-date (e.g. to remove tasks that have been completed) I have to query/poll the database every 3 seconds to get a refreshed dataset for the client application.



Is there a better way to poll the database, I am not sure querying the databse every 3 seconds is a good idea even if the query is very small.



Is there a way for the database to tell the application to refresh if a table is updated?



Thanks, Greg







sql-server sql-server-2008






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 5 '15 at 16:05









GregGreg

1




1





bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Sounds like you might want to look at BizTalk. microsoft.com/en-us/server-cloud/products/biztalk

    – Dave
    Oct 5 '15 at 17:20



















  • Sounds like you might want to look at BizTalk. microsoft.com/en-us/server-cloud/products/biztalk

    – Dave
    Oct 5 '15 at 17:20

















Sounds like you might want to look at BizTalk. microsoft.com/en-us/server-cloud/products/biztalk

– Dave
Oct 5 '15 at 17:20





Sounds like you might want to look at BizTalk. microsoft.com/en-us/server-cloud/products/biztalk

– Dave
Oct 5 '15 at 17:20










1 Answer
1






active

oldest

votes


















0














Polling might be an appropriate design for what you're doing here. It lets you control and tell the user exactly how fresh/stale the state is though 3 seconds is probably too frequent. 15 seconds seems to be a common threshold used by a lot of commercial applications and with Microsoft's tools (E.g. performance monitor). Some of SQL Server's system threads waked up every 15 seconds also.



That said, you can consider using query notifications (https://technet.microsoft.com/en-us/library/ms175110(v=sql.100).aspx) if you want a way to notify the app when the data you care about has changed. Essentially, you tell SQL Server the query you want to track and when the results for that query changes, your app gets a message. It is a bit of work to implement but the concept and coding are relatively simple.






share|improve this answer
























  • Would this also allow me to update other clients applications that are connected to the database? For example if Client A sends an update to Host A, I would like: - Host A to collect the update - Connected Client A, B and C to see the update on their screen

    – Greg
    Oct 13 '15 at 11:25













  • That's up to your app. QN provides notification to the app that the data set you care about has changed. You can then decide to auto-refresh what users see or wait till the next request/refresh before showing new/changed data. Both have pros/cons. Auto-refresh always shows latest without user action but can end up being unusable if the data is volatile. Waiting for next request/refresh from user can result in using stale data. A very common compromise is to notify the user data has changed and provide a "click here to refresh" button.

    – SQLmojoe
    Oct 20 '15 at 3:30











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f117046%2fsyncing-database-to-application-polling%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Polling might be an appropriate design for what you're doing here. It lets you control and tell the user exactly how fresh/stale the state is though 3 seconds is probably too frequent. 15 seconds seems to be a common threshold used by a lot of commercial applications and with Microsoft's tools (E.g. performance monitor). Some of SQL Server's system threads waked up every 15 seconds also.



That said, you can consider using query notifications (https://technet.microsoft.com/en-us/library/ms175110(v=sql.100).aspx) if you want a way to notify the app when the data you care about has changed. Essentially, you tell SQL Server the query you want to track and when the results for that query changes, your app gets a message. It is a bit of work to implement but the concept and coding are relatively simple.






share|improve this answer
























  • Would this also allow me to update other clients applications that are connected to the database? For example if Client A sends an update to Host A, I would like: - Host A to collect the update - Connected Client A, B and C to see the update on their screen

    – Greg
    Oct 13 '15 at 11:25













  • That's up to your app. QN provides notification to the app that the data set you care about has changed. You can then decide to auto-refresh what users see or wait till the next request/refresh before showing new/changed data. Both have pros/cons. Auto-refresh always shows latest without user action but can end up being unusable if the data is volatile. Waiting for next request/refresh from user can result in using stale data. A very common compromise is to notify the user data has changed and provide a "click here to refresh" button.

    – SQLmojoe
    Oct 20 '15 at 3:30
















0














Polling might be an appropriate design for what you're doing here. It lets you control and tell the user exactly how fresh/stale the state is though 3 seconds is probably too frequent. 15 seconds seems to be a common threshold used by a lot of commercial applications and with Microsoft's tools (E.g. performance monitor). Some of SQL Server's system threads waked up every 15 seconds also.



That said, you can consider using query notifications (https://technet.microsoft.com/en-us/library/ms175110(v=sql.100).aspx) if you want a way to notify the app when the data you care about has changed. Essentially, you tell SQL Server the query you want to track and when the results for that query changes, your app gets a message. It is a bit of work to implement but the concept and coding are relatively simple.






share|improve this answer
























  • Would this also allow me to update other clients applications that are connected to the database? For example if Client A sends an update to Host A, I would like: - Host A to collect the update - Connected Client A, B and C to see the update on their screen

    – Greg
    Oct 13 '15 at 11:25













  • That's up to your app. QN provides notification to the app that the data set you care about has changed. You can then decide to auto-refresh what users see or wait till the next request/refresh before showing new/changed data. Both have pros/cons. Auto-refresh always shows latest without user action but can end up being unusable if the data is volatile. Waiting for next request/refresh from user can result in using stale data. A very common compromise is to notify the user data has changed and provide a "click here to refresh" button.

    – SQLmojoe
    Oct 20 '15 at 3:30














0












0








0







Polling might be an appropriate design for what you're doing here. It lets you control and tell the user exactly how fresh/stale the state is though 3 seconds is probably too frequent. 15 seconds seems to be a common threshold used by a lot of commercial applications and with Microsoft's tools (E.g. performance monitor). Some of SQL Server's system threads waked up every 15 seconds also.



That said, you can consider using query notifications (https://technet.microsoft.com/en-us/library/ms175110(v=sql.100).aspx) if you want a way to notify the app when the data you care about has changed. Essentially, you tell SQL Server the query you want to track and when the results for that query changes, your app gets a message. It is a bit of work to implement but the concept and coding are relatively simple.






share|improve this answer













Polling might be an appropriate design for what you're doing here. It lets you control and tell the user exactly how fresh/stale the state is though 3 seconds is probably too frequent. 15 seconds seems to be a common threshold used by a lot of commercial applications and with Microsoft's tools (E.g. performance monitor). Some of SQL Server's system threads waked up every 15 seconds also.



That said, you can consider using query notifications (https://technet.microsoft.com/en-us/library/ms175110(v=sql.100).aspx) if you want a way to notify the app when the data you care about has changed. Essentially, you tell SQL Server the query you want to track and when the results for that query changes, your app gets a message. It is a bit of work to implement but the concept and coding are relatively simple.







share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 5 '15 at 17:35









SQLmojoeSQLmojoe

1,32037




1,32037













  • Would this also allow me to update other clients applications that are connected to the database? For example if Client A sends an update to Host A, I would like: - Host A to collect the update - Connected Client A, B and C to see the update on their screen

    – Greg
    Oct 13 '15 at 11:25













  • That's up to your app. QN provides notification to the app that the data set you care about has changed. You can then decide to auto-refresh what users see or wait till the next request/refresh before showing new/changed data. Both have pros/cons. Auto-refresh always shows latest without user action but can end up being unusable if the data is volatile. Waiting for next request/refresh from user can result in using stale data. A very common compromise is to notify the user data has changed and provide a "click here to refresh" button.

    – SQLmojoe
    Oct 20 '15 at 3:30



















  • Would this also allow me to update other clients applications that are connected to the database? For example if Client A sends an update to Host A, I would like: - Host A to collect the update - Connected Client A, B and C to see the update on their screen

    – Greg
    Oct 13 '15 at 11:25













  • That's up to your app. QN provides notification to the app that the data set you care about has changed. You can then decide to auto-refresh what users see or wait till the next request/refresh before showing new/changed data. Both have pros/cons. Auto-refresh always shows latest without user action but can end up being unusable if the data is volatile. Waiting for next request/refresh from user can result in using stale data. A very common compromise is to notify the user data has changed and provide a "click here to refresh" button.

    – SQLmojoe
    Oct 20 '15 at 3:30

















Would this also allow me to update other clients applications that are connected to the database? For example if Client A sends an update to Host A, I would like: - Host A to collect the update - Connected Client A, B and C to see the update on their screen

– Greg
Oct 13 '15 at 11:25







Would this also allow me to update other clients applications that are connected to the database? For example if Client A sends an update to Host A, I would like: - Host A to collect the update - Connected Client A, B and C to see the update on their screen

– Greg
Oct 13 '15 at 11:25















That's up to your app. QN provides notification to the app that the data set you care about has changed. You can then decide to auto-refresh what users see or wait till the next request/refresh before showing new/changed data. Both have pros/cons. Auto-refresh always shows latest without user action but can end up being unusable if the data is volatile. Waiting for next request/refresh from user can result in using stale data. A very common compromise is to notify the user data has changed and provide a "click here to refresh" button.

– SQLmojoe
Oct 20 '15 at 3:30





That's up to your app. QN provides notification to the app that the data set you care about has changed. You can then decide to auto-refresh what users see or wait till the next request/refresh before showing new/changed data. Both have pros/cons. Auto-refresh always shows latest without user action but can end up being unusable if the data is volatile. Waiting for next request/refresh from user can result in using stale data. A very common compromise is to notify the user data has changed and provide a "click here to refresh" button.

– SQLmojoe
Oct 20 '15 at 3:30


















draft saved

draft discarded




















































Thanks for contributing an answer to Database Administrators Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f117046%2fsyncing-database-to-application-polling%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...