Provides access to the database using concepts like scopes and transactions. More...
Classes | |
| class | mi::neuraylib::IDatabase |
| This interface is used to interact with the distributed database. More... | |
| class | mi::neuraylib::IScope |
| A scope is the context which determines the visibility of database elements. More... | |
| class | mi::neuraylib::IJob_execution_context |
| Provides information about the context in which a job is executed. More... | |
| class | mi::neuraylib::ITransaction |
| A transaction provides a consistent view on the database. More... | |
Provides access to the database using concepts like scopes and transactions.
The database does not support certain usage patterns. These patterns can not be rejected programmatically, but need to be ensured by the user for proper operation.
tags, which are not further explained here. See mi::neuraylib::IScope for general documentation about scopes.
Be careful when storing DB elements of the same name in different scopes. If the scopes are not in a parent-child relation, then the following limitation does not apply since no transaction will ever see both elements. But if the scopes are in a parent-child relation, then it is required that the store operation happens first in the parent scope and that this element is visible in the child scope before the store operation in that child scope occurs (in the same transaction, or with different transactions where the first one is committed before the second one is started). Otherwise, this results in different DB elements of the same name (and not just different versions of the same DB elements as it would happen when the correct order is observed).
Example (creation in wrong order):
While such a situation is not necessarily a problem for the database itself, it leads to unexpected behavior on the user side, as accesses might return different instances, depending on the details of the access method.
This limitation does not apply if there is already a DB element with that name accessible at the time of the store operation, i.e., the method does not create a new DB element, but essentially overwrites/edits an existing one.
See mi::neuraylib::ITransaction for general documentation about transactions.
Be careful when storing DB elements of the same name in parallel transactions, unless the corresponding scopes are different and not in a parent-child relation to each other. Failure to observe this limitation results in different DB elements of the same name (and not just different versions of the same DB elements as it would happen with serialized transactions).
Example (wrong creation in parallel transactions):
While such a situation is not necessarily a problem for the database itself, it leads to unexpected behavior on the user side, as accesses might return different instances, depending on the details of the access method.
This limitation does not apply if there is already a DB element with that name accessible at the time of the store operations, i.e., the method does not create new DB elements, but essentially overwrites/edits an existing one.
Note that editing (as opposed to storing) the very same DB element in parallel transactions is supported by the database, but it is discouraged, since the semantics might not be as desired (see mi::neuraylib::ITransaction ).
See mi::neuraylib::IScope for general documentation about scopes.
Be careful when creating references to DB elements that exist in a different scope than the referencing element. References to elements in parent scopes (or the the same scope) are perfectly fine. But you must not create references to DB elements that exist only in a more private scope. Typically, this happens when using mi::neuraylib::ITransaction::store() with an (explicit) wrong privacy level.
Example (invalid reference to element in more private scope):
A reference to an element in a more private scope triggers an error message when the referencing element is stored in the DB, but does not prevent the operation from being completed nor is it signaled via a return code. As soon as the incorrect reference is used, this triggers a fatal error message (and the process aborts if it returns from the logger callback). Even if the incorrect reference is never used, its existence hints at a conceptual error in the way the application uses scopes.