# Synopsis

PDX_MSGT map_CommitEntity(long option, MDA_PTR db_ptr, MAP_INFO *info, MDA_PTR *new_db_ptr)

# Purpose

Commit a mapped entity.

# Description

This function is called to commit or save the results of a mapping. The application does need to directly call this function unless an application dispatcher has been defined. In this case, the dispatcher should call this function before making any changes to the mapped entity.

When this function is called, it determines whether or not db_ptr is a transient entity (a temporary entity generated by a mapping function). An entity is considered transient if it resulted from a mapping defined with the MAP_TRANSIENT option (see the map_DefineMapping manual page) or the entity passed into the mapping function was already a transient entity. If the entity is transient, @a *new_db_ptr is assigned to db_ptr. If the entity is not transient, it is recursively copied to the same model it is defined in and @a *new_db_ptr is set to the new entity.

Regardless of db_ptr being transient, the caller can safely modify @a *new_db_ptr upon returning.

# Input

## option

Option (not used)

## db_ptr

Entity to be committed

## info

The mapping information structure

# Output

## new_db_ptr

The committed entity

# Return

MAP error code