Home
Home Page
Circuits of blocking in Databases
Blocking of the Table
Blocking of page
Compression of the data with a view of economy of a place and acceleration of job Oracle
Compression of the data with a view of economy of a place and acceleration of job Oracle
Service of events in the SQL-server
Offered variant of the decision
SQL Server in questions and answers
Boards - how to benefit
Development Ajax: Use XML in searches and answers
Transfer of pairs name / value (name/value)
Transfer XML on the server
All in the frameworks
Creation of wap-pages (in a format *.wml)
How to recover Perl/CGI a script
Mezhprocessovye interactions
Kill of the target data
Correctness at construction of a resource!
Example of a tree
Links
 

 

Offered variant of the decision


The variant of the decision of a problem, free from set forth above (all set forth above is offered to your attention!) problems, but at the same time idle time suffices. The idea is those: on the server a certain binary object is located, which sql-server can cause (and it can be only extended stored procedure or activex-object), having two not interconnected methods.

The first method creates with the help of function win32api createevent object of a nucleus win32, called "event" with the unique name transferred{handed} in parameter. Further function win32api waitforsingleobject is caused, having come across on which, the stream stops and costs{stands} pending, while this object of a nucleus not zasignalit. I pay your attention, to that fact, that such objects of a nucleus can be created as much as necessary. It is limited only kol-vom khendlov in system.

The second method causes object of a nucleus event by name, in the set parameter, with the help of function win32api setevent and exposes to him property "signaled". As soon as it will take place, the stream with the first method wakes up and returns management to called process. The second method, does not expect result, and returns management to the called process at once after exhibiting property "signaled". Thus it is reached{achieved} asinkhronnost`.

Now it is necessary to make only stored{kept} procedures t-sql, managing this object and the necessary functionality " at us in a pocket ". The client program in a separate stream starts stored{kept} procedure of expectation of event, passing parameter the unique attribute - address. It can be both a login name, and a name of a computer, and any line. The main thing that it was the unique identifier within the limits of client-server system. Stored{kept} procedure will return result only in case for this addressee event will be generated. At reception of event, procedure is restarted. At closing the program the stream of expectation of event is simply beaten through terminatethread.

At first sight this of a method possesses "awful" lack - there is a constant connection with the sql-server which does{makes} nothing the most part of time. But it only the first impression. Actually, resources here only on maintenance of a connection will be involved is something a little bit{some} kilobyte on session. And all! More than any tangible resources to not be spent, it is especial on a background of advantages which are described below. It is possible to not worry about additional licenses too if the model of licensing " per server " is chosen. In this case from one machine there can be some connections to the sql-server, all this will borrow{occupy} equally exactly one client license.



The ready decision


The decision will consist of activex-object as a file algoevt.dll and two stored{kept} procedures spwaitforevent and spraiseevent. Before use this file should be placed on the server and to register activex-object with the help of the system utility regsvr32.exe. Further all job will be made through stored{kept} procedures. In the ready decision a little bit big functionality, than in the described concept is realized. Except for the fact of event, it is possible to pass also the any information as a line in size up to 250 symbols. Each procedure has two parameters. The first is a unique identifier - address about which it was spoken above, and the second parameter - the additional passed information. spwaitforevent it is necessary to call from the client from a separate stream (a priority of a stream it is possible to choose the lowest). At reception of event, procedure should be restarted. It is necessary to set a time-out of execution{performance} of search infinite.




Advantages of the decision


1. Independence of the network report and adjustments of a network. The connection to the sql-server would be.

2. Asinkhronnost`. The initiator of event does not wait, when the client will receive event. It is possible to initiate events in the trigger, return occurs instantly.

3. Absence of a delay of delivery.

4. A guarantee of delivery.

5. Absence of practical restrictions on kol-in the clients expecting event.

6. Resources are not spent, except for insignificant resources for maintenance of connections.

7. Absence of the "left" network traffic.

8. It is not required additional services and programs.

9. It is not required additional adjustments of the sql-server.