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

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

What is the meaning of "notice to quit at once" and "Lotty points”

How do you say “my friend is throwing a party, do you wanna come?” in german

PTIJ: Should I stay away from my computer?

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

PTIJ: What dummy is the Gemara referring to?

Reason why dimensional travelling would be restricted

Formatting a table to look nice

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

Meaning of '4:1 (3:0)' as score in football (World Cup match)

I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?

Can a Trickery Domain cleric cast a spell through the Invoke Duplicity clone while inside a Forcecage?

Why doesn't "adolescent" take any articles in "listen to adolescent agonising"?

Why are special aircraft used for the carriers in the United States Navy?

What is better: yes / no radio, or simple checkbox?

Can I solder 12/2 Romex to extend wire 5 ft?

Ahoy, Ye Traveler!

Where is this quote about overcoming the impossible said in "Interstellar"?

Quitting employee has privileged access to critical information

Lock enemy's y-axis when using Vector3.MoveTowards to follow the player

An Undercover Army

Find maximum of the output from reduce

Specific Chinese carabiner QA?

Why won't the strings command stop?



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 8 mins 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 8 mins 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 8 mins 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 8 mins 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

ORA-01691 (unable to extend lob segment) even though my tablespace has AUTOEXTEND onORA-01692: unable to...

Always On Availability groups resolving state after failover - Remote harden of transaction...

Circunscripción electoral de Guipúzcoa Referencias Menú de navegaciónLas claves del sistema electoral en...