Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Creates a scratch instance of the specified instance type. A scratch instance is located in the scratch model, i.e., scratch instances will not be written to the persistent EDMdatabase.
All EDMinterface access operations defined for persistent instances are applicable on scratch instances.
Note: Scratch instances can have relations to persistent instances but persistent instances cannot have relations to scratch in stances.
The scratch model is a volatile model that is deleted when the session is closed or the database is closed. The scratch model can hold instances of any instance types defined by any dictionary models in the EDMdatabase. Each open session has it own unique scratch model, hence the data in a scratch model cannot be shared between concurrent users of an EDMdatabase. The scratch model will implicitly be created and open for write access when the session is opened.
The dictionary model that specified by the <schemaName> must be open before this operation can be successfully performed.
A scratch instance can be deleted by the sdaiDeleteInstance , edmiDeleteInstanceAndReferences , edmiDeleteAllScratchInstancesOfSchema , edmiDeleteAllScratchInstancesOfSchemaBN operations. All scratch instances are deleted when the open session is closed or when the database is closed.
Related functions: edmiCreateScratchInstanceBN , edmiCreateScratchInstanceAndPutAttrs, edmiCreateScratchInstanceAndPutAttrsBN , sdaiDeleteInstance , edmiDeleteInstanceAndReferences , edmiDeleteAllScratchInstancesOfSchema , edmiDeleteAllScratchInstancesOfSchemaBN
Header:
#include "sdai.h"
Prototype:
SdaiAppInstance edmiCreateScratchInstanceBN(SdaiString schemaName,
                                             SdaiString entityName); 
Arguments:

schemaName

Specifies the name of EXPRESS schema that defines the actual instance type to be created. This EXPRESS schema must exist as a dictionary model in the EDMdatabase. Schema names are case insensitive. Schema names are unique in an EDMdatabase.

entityName

Specifies the name of an entity in the schema <schemaName>. The combination of <schemaName> and <entityName> uniquely defines the instance type to create. Entity names are case insensitive.

Returns:
A numeric instanceID that uniquely identifies the new created entity instance in the EDMdatabase. This instanceID should be used to identify the particular instance for subsequent EDMinterface operations.
instanceID != 0 : operation successfully performed.
instanceID = 0 : operation failed, use sdaiErrorQuery function to get error reason.
EXAMPLE
SdaiAppInstance instId;
...
instId = edmiCreateScratchInstanceBN ("Example_Schema", "Person");
if (! instId) {
/* Error in operation */ 
printf("\nError in edmiCreateScratchInstanceBN: %s\n", 
edmiGetErrorText(sdaiErrorQuery())); 
goto error; 
}
. . .

  • No labels