About Streaming Query and Expand

You can enable streaming in a query or an expand operation in order to fetch the results one page at a time. When you enable streaming, data is returned when the first page is available, resulting in improvement in performance and memory consumption. When streaming is used, no data is held in cache. Therefore repeating the same operation in a transaction can result in the system issuing the same sql database requests each time.

Streaming query and expand is enabled by default. To disable this function, edit the enovia.ini file with the following setting:

MX_QUERY_PAGE_SIZE=0

Only results from local vaults are streamed.

Streaming can be enabled through the MX_QUERY_PAGE_SIZE environment variable, through classes in the Studio Customization Toolkit, or at runtime by using the size clause in MQL temporary query or expand business object commands. You can override any value set for streaming in temporary queries and expands by using the size clause. For information on MX_QUERY_PAGE_SIZE, see "Optional Variables" in the ENOVIA Live Collaboration Installation Guide. For information on using the size clause, see "Reference Commands" in the MQL Guide.

Enabling streaming through the classes usually provides the greatest improvement in performance and memory consumption. The following iterator classes are used: QueryIterator, RelationshipQueryIterator and ExpansionIterator. These classes must be defined, used, and closed within a single transaction boundary. The transaction must be started before using getIterator and the iterator must finish its work before the transaction is completed. If these classes are not used within a single transaction, the following error will occur: QueryIterator must be used within a transaction.