Re: Locks in a business layer
Hello, IB, you wrote: P_K>> It is necessary, it agree. But complexity grows as a snow clod and it is all quickly quits from under control, when it at basis level. IB> if complexity grows from operation at storage level, something means you do not so, should be equal on the contrary. I meant when locks transactions at basis level they, locks, quickly get out of hand. We admit all it is comprehensible works on such locks. Here there is a new feature, in the list of checks reading of new essence (so also lock) is added. One more feature, then one more is then added. And it not in one business action, and in some. As a result of check lock conditionally half-bases and "greetings, !" Gets out of hand - because writers of the business code do not know that there the basis blocks. It is an individual question for which likely it is necessary competent DBA. P_K>> it is similar that the architectural decision doing as a matter of fact the same locks that is required the DBMS, but in business layer terms is able. I hope that as a result of lock become more predicted and visible. IB> on the contrary, in this case all generally quits from under control, or will be strictly one-continuous and not scaled. The storage is a unique place where it is possible more or less adequately problems with the data. Here I will dare to disagree. Let our business code finds any essence in serializable-transaction from basis (some lines from pairs of tables). What will the basis blocks? Only the read lines? Any pages (i.e. in advance unpredictable dial-up of entities)? All table (all entities)? Here I cannot answer this question, it it is necessary to be dug in very deeply in basis. That is for me automatic locks of storage - a thing unpredictable so such decision adequate you will not name. If locks not automatic, predicted unique argument against basis I see a productivity question. What for to run in basis if it is possible in storage? Scalability (some app-servers) on is required. IB> Basically, in each DB there is a possibility to use the mechanism of locks for needs of an application-oriented layer. For a sequel it is pair of procedures sp_getapplock/sp_releaseapplock, but it is equal about the same, simply allows to synchronize also entities which directly are not stored in a DB. Interesting, did not know, thanks.