Data Separation, Mechanism. Vykoristannya to the mechanism under the data substitution RLS Submitted month of date

The 1C:Enterprise system has the ability to conduct information in one information base appearance in a number of enterprises. For which purpose is the image separator used?

The choice of the volume separator is determined by the configuration. If the configuration is set to a specific area separator, then the scoreboard allows you to select a specific area separator value for which accounting results are displayed.

To set the value of the water separator, use the speedy item "Rozdilyuvach obliku" menu "Dii" or a button on the toolbar. When this happens, a dialogue appears on the screen to set the value of the image separator.

In the field "The importance of a separate image" You can specify the specific meaning of the separator in the form. The method for entering the value depends on the type of separator specified by the configuration. As a rule, it’s the right person. In this case, to select a value, quickly press the selection button and select the required value from the list of indicator values.

Button "Empty value" Allows you to erase the entered value of the volume separator in order to insert an empty value. There is a sense at once, because, instructing the specific values ​​of the separator to the area, the postings have been changed and the values ​​are empty.

Praporets "Across all" Allows you to set the mode for displaying pouches for all values ​​of the bag separator in the bag.

To set the selected values, press the button "OK". To view the selected value – button "Vіdmina".

After setting the selected values ​​of the scoreboard, sums are displayed for specific values ​​of the volume dispenser, either for empty values ​​or for all values ​​in the total, depending on the option selected in the dialog.

1. Preamble.

There is a need to organize the appearance of two organizations in one IB. The situation is not unique, but it turned out that our very non-standard 250 gigabyte UPP was working too hard, so instead of RLS we decided to try half of the data. What is described in the same way, for example, or. In short, RLS adds brains run SQL, then the data separator is an additional element in tables on the level of a DBMS, with the help of which the mechanism is responsible for processing related RLS.

Now, to the base, the entire structure of TOV No. 1, it is necessary to transfer information from the adjacent base of TOV No. 2 and organize sleepy robot. Just like in the picture:

Mere mortals work only for their own TOV, and heads sometimes marvel at the data on two sides. In the access mode to both TOVs, you can only read the data, which is due to the ability to interactively switch between the “read all” / “write only for one organization” modes and select the TOV (to set the values ​​of the entry details) for carrying out, for example, the development of social security.

2. Implementation

Platform 8.2.19.90 without the mode of darkness. DBMS – MSSQL Server 2008 R2 Standard.

We created the official details of Organization of Business Development of the “number” type, decided to create parameters for the session, filled the warehouse with the details (included a number of advisers, all documents, accumulation registers, accounting and accounting). The bottom of the data is “Independent and sleepy.” The parameter value for the session is set using standard adjustments koristuvach in the procedure SettingSessionParameters in the session module:

Organization = Management of Koristuvach.OtrimatiValniyaZa Umovchanyam (chap. Current Koristuvach,"Main Organization");
SessionParameters.OrganizationRozdilyuvachValues ​​= Organization.RozdilyuvachValues;

In the interface of the head accountant, we created a form with the ability to switch between organizations and enable/disable the sub-section mode:

When separated is enabled, if Session Parameters. Organization Rozdilnik Vikoristannya = Nonsense, the platform is supposed to record documents that are valued with amortizations like “SDBL amortization: viraz (pos=12)”, so it is not possible to allow correspondents to record documents in this option. For reliability, we have created subscriptions to the “Before recording” section for objects that are included in the warehouse with the following details:

How to parameterize the session.OrganizationRozdilyuvachVikoristannya = Nonsense
#As a Client Todi
Poperedzhennya (“It’s impossible to write it down, because the bottom of the data is hidden!”);
#KіnetsYakscho
Vidmova = True;
KinetsYakscho;

Our plan of action is as follows: we have prepared the configuration-receiver IB No. 1, set the value of the initial attribute = 1, set the data from IB No. 2 after setting up for all objects with empty 0) the values ​​of the separator are set to Organization of Disposal = 2.

The configuration has been prepared, the power has arrived, how to set the values ​​of the legal details for documents and their documents during closed periods, and without risk of the balance numbers flying? Through the 1C object model, it is impossible to write a separator directly from the object, which happened to destroy the license agreement and write a request for MS SQL. There are a lot of objects in the warehouse of the personal details, and the table in the warehouse behind these objects is even larger, they wrote a routine that generates a query for SQL (for each metadata object that enters the warehouse of the separator, they wrote “update” + Im 'i_DB + ".dbo._" + TableName + "set _" + FieldRegistry + "= 1";)

We entered the values, transferred some of the data from IB No. 2, and began testing.

The result was disappointing. First of all, there are problems with the accounting register. When the section is closed, it is not visible to the analyst:

This is due to the fact that the accounting register is saved as a single table on the level of the DBMS, and all tables have been assigned the value of the registration details (for the review of the structure, the editing was used).


Okay, let’s enter the separator values ​​via MS SQL, including analytics. People don't bother calling. It appears that there are problems with the entries in the virtual tables of the accounting register "Turnover" and "TurnoverDtKt":

(Fld27033 is just a hidden detail in the accounting register table)

The distribution of statements in all tables, as can be seen on the DBMS level, is not clear. We fire up a typical empty UPP, as described in detail, the changes in the configuration are introduced, a couple of documents are entered (in this case, the platform itself inserts the separator values ​​in all tables of the accounting register), and the approvals are created. It’s bad, except we turn on the accounting register and the warehouse of the legal details, testing continues.

Further, it is clear that the registration mechanism in the registers has ceased to function. We didn’t have plans for the types of expansion, so we are trying to find the problem in the tables of the register of divisions and in the divisions. We check it, put the values ​​of the main details, but still - to no avail.

Presumably, the problem is diagnosed after recording in the independent register of information from the list form. Once data is registered, it can be restored after restarting. The problem also occurs on the test base:


The register of data was not successful in the way of manipulating with SQL (the separator value was installed in all tables), so they were simply turned off from the warehouse of the legal details. After several days of experimentation, attempts to renew the fruitfulness of the world appear in the near future.

At this point, we have decided to turn on the data section and select RLS. When setting the field to “do not select”, I encounter the error “Microsoft OLE DB Provider forSQL Server: CREATE UNIQUE INDEX terminated because a duplicate keywas found for index...”. If you turn around until you reach the floor, you won’t go out so easily. There is a problem with the indexes, table of changes, bag saving parameters and others. On the right is that identical rows are saved in the tables, which are related to the values ​​of the original details. When you delete your personal details, unique records will appear. Let's delete unnecessary records directly in MS SQL something like this (for the table of re-arrangements):

Use base;
ALTER TABLE_CRgRecalc1399
ADD ID INT IDENTITY(1,1);
GO
DELETE FROM_CRgRecalc1399
WHERE id< (SELECT MAX(id)
FROM _CRgRecalc1399 AS T1
WHERE _CRgRecalc1399._RecorderTRef = T1._RecorderTRef and
_CRgRecalc1399.[_RecorderRRef] = T1.[_RecorderRRef] and
_CRgRecalc1399.[_CalcKindRRef] = T1.[_CalcKindRRef] and
_CRgRecalc1399.[_Fld1400RRef] = T1.[_Fld1400RRef] and
_CRgRecalc1399.[_Fld1401RRef] = T1.[_Fld1401RRef] and
_CRgRecalc1399.[_Fld1402RRef] = T1.[_Fld1402RRef]
);
GO
ALTER TABLE_CRgRecalc1399
DROP COLUMN id;

And after cleaning several dozens, the table goes into the data section. After all, there are no everyday problems.

3. Visnovki.

There was a glimmer of hope that at 8.3 the problem had been solved. We didn’t check, we checked on 8.3.4.482 (with the density mode turned off). We saw a practically standard UPP-shka, with changes in the configuration except for the basic details. For this test basis, the subsection was included before entering information, then. The platform is too small to correctly record the separator values ​​for all tables; we didn’t write anything independently in MS SQL.

Result:

    The problem with queries to the virtual tables “Turnover” and “TurnoverDtKt” is created.

    The problem is emerging.

    A problem with the entry in the independent register of accounts appears.

    The problem with the keys below is that pressing the button alone will not wake you up!

As such, we were unable to replace the RLS with a new mechanism. Having planned this mechanism, perhaps, for gloomy services, and in the option of selecting the data “independently”, you may ask for a subsection, otherwise we need a hidden NSI. You will no longer need to check if 1C corrects the errors, and even better, it implements a typical mechanism for subdivision of organizations in standard configurations.

Apparently we discussed mechanisms for limiting access to 1C and zokrem for koristuvachs.

It allows the buyer to process not only documents, but only those that include the organization and warehouse. The selections are made dynamically, so it is important to process the data base.

The power of the official requisite-distributor – Subfield of koristuvach 1C – allows you to establish the availability of the list of koristuvach separately from the victorious separator.

If you separate inclusions for a customer, then it will be visible in the list of customers in the 1C Entrepreneurship mode - otherwise it will not be visible.

In this way, it is possible to organize different lists of contributors for different parts of the database.

The power of the legal props-separation agent - 1C authentication section - allows you to create accounts with the same account names for different parts of the database.

Umovnyi podil 1C

The 1C smart unit allows you to turn on and off the separator on the base data stand. In this way, it is possible to create stale lanyards of one type or another, dynamically operating ones for one or another type.

In order to include the intellectual subfield 1C, it is necessary to indicate from the authorities the official requisite-distributor - the Mental subfield 1C - which is indicative of the fact of inclusion in the 1C subdivision.

It is possible to use a constant with a boolean type or a props with a boolean type.

Important - for this constant/advisor, you need to enable the Victory (select Do not Victory) at the warehouse of separators, only then it will be possible to select it.

What do you learn from this article?

  • The statistics show the significance of the mode under the pouches
  • The behavior of the “1C:Enterprise 8” system during parallel work of a large number of employees is analyzed
  • The minuses of the mode are shown under the pouches
  • There are recommendations for correct entry under the registry subbags

The “1C:Enterprise 8” platform contains possibilities and mechanisms, the operation of which is not entirely clear, as well as the methods of their effective recovery. This is the mode under the pouches.

The mechanism under the pouches is even more important and corisna function: yogo vikoristannya It is possible to create a parallel entry in the accounting register and the accumulation register.

Let's demonstrate effectiveness given the regime for additional help butt. For this purpose, let’s look at the situation before and after turning on the under-bags mode.

Before turning on the mode under the pouches

We obviously have two new documents with numbers 001 and 002:

Once the documents are processed, they will be processed according to the accumulation register. There is no control over surplus. Structure of the accumulation register:

Two clerks, working with their documents, begin their one-hour activities. The situation arises when two documents of the same type are trying to make money at the same time.

With this in mind, on the level of the DBMS, the following picture emerges:

What is included in the system:

  1. Documents are required to be entered into the accumulation register
  2. On the level of the DBMS, the register of accumulated views consists of two tables: the table of accounts and the table of surpluses (table of subsums).
  3. The table of accounts can record its data in parallel with documents. This will ensure different values ​​in the “Registrar” field, and, obviously, work with different rows in the table.
  4. And the axis of the surplus table does not have the “Registrar” field, the data in this table is saved in relation to the modification of the register itself.
  5. Here, a situation arises when two documents need to change one record, but it is not possible to change one record at the same time.
  6. In order not to waste the data that is recorded, each document must check its notes for the record until the other document records its records. And after the first of the documents has contributed his input, the other can contribute his.

As a result, we are afraid of wasting an hour - another buyer will check for the completion of the document from the first one. On the one hand, everything is correct and logical, on the other hand, the parallelism of the work of the system’s employees suffers.

To solve the problem, it was solved and a mechanism was created under the pouches.

This vikoristannaya is transferred only to the accumulation registers and accounting registers.

Increasing the mode under the bags

The end of this regime is simple:

Please note that the mode under sub-bags of inclusions for all created registers is accumulated and accounting. In the Configurator mode, we can see for which registers the following mode is enabled:

What happens after switching to the under-bag mode?

The table of pouches and the savings/accounting register now has a new section “Rezdilyuvach”. The DBMS itself is called “Splitter”.

When the table of accounts is no longer unchanged, the “Registrar” acts as a separator. The change can be found in the results table.

This field will be filled in as soon as two (or more) transactions attempt to change one row in the bags table. In such a situation, the “Rozdilyuvach” field is saved different meanings for skin transactions.

This implementation of the sub-bag mode allows concurrent recording of all transactions.

In an application with two documents, when the mode is turned on, beware of the following:

Having offended our documents, they created a parallel record of their data in the new field “Rozdilyuvach”. As a result, there is no problem with cleaning up during blocking hours and the parallelism of the work of the operators is increased.

Disadvantages of the mode under the pouches

When this mode is enabled, the size of the table of register entries increases through those that have been added to a new field, and a number of rows appear in the set instead of one.

When withdrawing surpluses from the register, there is a need for a handful of data, which can lead to up to a loss of time, no matter how insignificant.

Our problem with two documents for removing the surplus of the “Steel” product behind the “Main” warehouse is due to the need to fold two rows to remove the pouch value “7”. With a single-purpose separator, grouping of rows (folding) is not required.

When should you choose the mode for the subdivision of pouches?

For whom it is necessary to viconate your mind:

  1. As long as the register does not control surpluses, it is impossible to read transaction data. Accounting registers have control over surpluses, daily. If we control surpluses, then we do not take away a huge gain from productivity. In addition, when controlling surpluses, it is necessary to use the power of the “Block for Change” set of records, since there is a possibility of cross-blocking.
  2. A parallel work of koristuvachev is entered into the register, and is active.

During subsequent robots with a register or robots with a small number of accounts, there is no sense in turning on the sub-bag mode: the number of competing transactions does not result in blocking, and, apparently, there is no This is the effect of violating the mode at the bottom of the pouches.

Burmistriv Andriy