StoreDoc() API returns error code 2

Symptoms

Your StoreDoc() API returns an error code of 2.

Causes

For the StoreDoc() API to successfully load a document, two attributes must be set in the following way:
  • The application group's Database Organization must have the attribute Multiple Loads per Table selected in order for StoreDoc() to succeed. This attribute is set in the General/Advanced tab in the Properties window of the application group.
  • The application group's Expiration Type on the Storage Management tab must be set to Segment or Document in order for StoreDoc() to succeed. This attribute is set in the Storage Management tab in the Properties window of the application group.

Resolving the problem

Make sure that both attributes of the application group are set correctly.