powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / PowerBuilder [игнор отключен] [закрыт для гостей] / Кеширование DW
4 сообщений из 4, страница 1 из 1
Кеширование DW
    #33251110
Chistyakov Victor
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Народ, подскажите, задача следующая:
При открытии окна редактирования записи постоянно вычитываются в DropDownDW, по сути одни и те же значения. Можно ли каким-то образом при первом открытии все необходимые мне данные вычитать куда-то а потом при повторном открытии использовать их.
...
Рейтинг: 0 / 0
Кеширование DW
    #33251194
Фотография PL99
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Chistyakov VictorНарод, подскажите, задача следующая:
При открытии окна редактирования записи постоянно вычитываются в DropDownDW, по сути одни и те же значения. Можно ли каким-то образом при первом открытии все необходимые мне данные вычитать куда-то а потом при повторном открытии использовать их.
Вотэто видимо: PowerBuilder Help n_cst_dwcache
Description
Caching service. This object is designed to contain data used in multiple places within an application. It provides a single data source, eliminating redundant database retrievals.
...
Рейтинг: 0 / 0
Кеширование DW
    #33251997
rcryo
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
n_cst_dwsrv_cache (inherited from n_cst_dwsrv)
Description

The DataWindow Cache service works with the global DWCache service to cache u_dw controls and child DataWindows. These services are best utilized in MDI applications where two or more u_dw controls could be instantiated and using identical DataWindow objects at the same time. Caching allows only one DataWindow object or datastore to be present in memory while two or more controls share the same object.

It works by first scanning all objects on the DataWindow looking for drop down datwindow columns that have been designated for caching. If one is found, the child DataWindow is cached. Next, it looks at the u_dw control's tag value to see if it has been designated for caching and caches it. In both cases the objects are cached using the name provided by the programmer in the object's tag value.

Because the DataWindow Cache service is subordinate to the global Cache service, the programmer can accomplish the same results with manual calls to the global service. See n_cst_DWCache for additional information.

The global DWCache service actually manages the caching process and maintains an array of datastores, cache names, and retrieval arguments. The DataWindow service simply submits objects to it for caching. When a DataWindow object is passed to it, the DataWindow syntax is extracted and used to create a new datastore object. The datastore is then retrieved, using the designated retrieval arguments if any, and a ShareData issued back to the requesting control. If a cache already exists with the same name, a ShareData is issued.

How To

1. Turn on the Cache service from your u_dw control. Typically, this is done in the Constructor event of the control via the method call of_SetCache ( TRUE ).

2. The of_DataObjectChanged method is called from the u_dw control's ue_DataObjectChanged event, which is triggered when a u_dw is instantiated or when the dataobject is changed dynamically during runtime. It ensures that the global cache service is instantiated and then calls the of_CacheObjects method, which scans the control for caching tag values and, if necessary, caches objects.

Requirements

You must supply a cache name for every control and/or child DataWindow being cached. Use the CacheName tag value to designate the name. For example, to cache a u_dw containing employee names you would place CacheName=Employee; in the u_dw control's tag value. Later, if you attempt to cache a u_dw control that uses the same cache name, the service sees that it has already been cached and subsequently performs a ShareData to it. NOTE: The developer is responsible to make sure the DataWindow buffers are the same.

Options

The Cache service can accommodate DataWindows that have retrieval arguments. However, you must supply valid retrieval arguments via tag value assignment. For example, if your DataWindow has defined retrieval arguments user_id and company_id, you would use the following tag value CacheArguments=ttucker,1001. When the object is cached, the retrieval arguments are stored in the global cache service and used when it is retrieved. Although all tag values are extracted as strings, the service is intelligent enough to parse the DataWindow syntax for the proper data types of the retrieval arguments and convert the tag value strings to their proper datatypes.
...
Рейтинг: 0 / 0
Кеширование DW
    #33252112
Chistyakov Victor
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Спасибо, буду пробовать
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / PowerBuilder [игнор отключен] [закрыт для гостей] / Кеширование DW
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]