7
N SIGNALR & SQL DEPENDENCY Bart Callaerts

SignalR & SQL Dependency

  • Upload
    narato

  • View
    1.244

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SignalR & SQL Dependency

NSIGNALR &

SQL DEPENDENCY Bart Callaerts

Page 2: SignalR & SQL Dependency

HOW WE DID IT IN THE PAST We used to implement a polling system

Client Server

Got new Data ?Got new Data ?Got new Data ?

Got new Data ?

Here is new data

Got new Data ?

Got new Data ?Got new Data ?

Got new Data ?

Page 3: SignalR & SQL Dependency

WHAT IS SIGNALR ? ASP.NET SignalR is

•Library that makes developping real-time web functionality easy•Allows bi-directional communication between server and client•Server can push content to connected clients instantly•Supports websockets and falls back to other compatible techniques for older browsers

Page 4: SignalR & SQL Dependency

SQL DEPENDENCY• A sql dependency object can be associated with a sql command in order to detect when query results differ from those originally retrieved.• Assign a delegate to the OnChange event, which will fire when the results change for an associated command.

Page 5: SignalR & SQL Dependency
Page 6: SignalR & SQL Dependency

LIMITATIONS FOR SQL DEPENDENCY Query notifications are supported for SELECT statements that meet the following requirements: •The projected columns in the SELECT statement must be explicitly stated, and table names must be qualified with two-part names. Notice that this means that all tables referenced in the statement must be in the same database.

•The statement may not use the asterisk (*) or table_name.* syntax to specify columns. •The statement may not use unnamed columns or duplicate column names. •The projected columns in the SELECT statement may not contain aggregate expressions unless the statement uses a GROUP BY expression. When a GROUP BY expression is provided, the select list may contain the aggregate functions COUNT_BIG() or SUM(). However, SUM() may not be specified for a nullable column. The statement may not specify HAVING, UBE, or ROLLUP.

•The statement must not reference a view. •The statement must not contain any of the following: DISTINCT, COMPUTE or COMPUTE BY, or INTO. •The statement must not reference tables or views from other databases or servers. •The statement must not contain subqueries, outer joins, or self-joins. •The statement must not use any of the following aggregate functions: AVG, COUNT(*), MAX, MIN, STDEV, STDEVP, VAR, or VARP.

•The statement must not contain conditional statements that cannot change and cannot return results (for example, WHERE 1=0).

Page 7: SignalR & SQL Dependency

DEMO ARCHITECTURE : FLIGHT INFOASP.Net

webserver

Sign

alR

Conn

ectio

n

Console application,

hooked on SQL depdency

Sql Dependency

Flight Info Administrati

on

Sign

alR

Conn

ectio

n1

2

3

Client watching Flight Info

Sign

alR

Conn

ectio

n

4

Client watching Flight Info

4