Desktop version

Main > Knowledge Base > Knowledge Base > Knowledge base > Practical developer guide 8.3 > Lesson 14 (3:20). Optimization of posting the Services document > Theory > "Point in time" concept > Practical developer guide 8.3 > Lesson 14 (3:20). Optimization of posting the Services document > Theory > "Point in time" concept

"Point in time" concept

The Date document attribute determines its position on the time axis. A date includes time with one second precision. This allows you to control the document writing order. However, when a large number of documents are created, some documents might have identical dates (because they are created within a single second). How does one determine the sequence of document creation in this situation?

The point in time concept has been introduced to deal with this problem. A point in time is composed of date, time, and a reference to a database object. This lets you explicitly identify the position of any reference type database object on the time axis, but it generally only applies to documents. The point in time also allows you to determine the order of nonobject data, such as register records that are subordinate to a recorder.

The point in time concept is implemented in 1C:Enterprise script as the universal PointInTime object. This object has the Date and Ref properties, which provide you with the option to get the point in time "components", and a single Compare() method that compares two points in time. Besides, a PointInTime object has a constructor and can be created explicitly for any database object of reference type.

For multiple documents that have identical dates and times, the platform determines their order on the time axis based on the references to these documents. The order does not always match the order of document creation, and it is not available to users, so they cannot change the order of documents within a one-second period or determine that one document was created before another.

The platform generates a real-time timestamp at each real-time document posting. The timestamp value is generated based on the current time and the last real-time timestamp generated.

If the last real-time timestamp that was generated is less than the current session time, the current session time is used as the new real-time timestamp.

If the last real-time timestamp is equal to or greater than the current session time, the real-time timestamp is set to a value one second greater than the old real-time timestamp.

So, the platform processes posting of Document configuration objects that have real-time posting enabled (fig. 14.30) as follows:


Fig. 14.30. Enabling real-time document posting

Next page: Checking the balances




© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.