Schema Change

To extend the logical schema, OLE DB Provider for Commerce Server must be notified by turning on the schema change mode. Changes to the existing schema are not allowed when in schema change mode. The __Commit attribute determines whether changes are persisted to intermediate tables. The CommitSchema command persists the session changes to the actual schema tables, provided all changes pass validation.

When extending the schema, perform the following steps:

  1. Turn the schema change mode on by setting the SchemaMode attribute to 1.

  2. Create a new instance in the schema table you want (ClsDef, MemDef, and so forth).

  3. Set the attributes you want.

  4. Set the persistence of the new row using the __Commit attribute.

  5. Save the changed row using the Update method.

  6. Repeat steps 2 - 5 for each additional row to be added.

  7. Commit the session changes by executing the CommitSchema command.

  8. Turn the schema change mode off by setting the SchemaMode attribute to 0 (zero).

Commit

The __Commit attribute determines whether the data inserted into a row will be persisted and when.

When setting row data in OLE DB Provider for Commerce Server in Fastload mode, the data is buffered. Two values, Flush (do not save current row) and Save and Flush, explicitly (and synchronously) flush the data to the database.

It is recommended for C++ applications that have high load requirements to use row reuse. Normally, an application will create an instance of a blank row through the OLE DB 2.6 binder interface, populate the column data, commit the data, and release the row. The Reuse Row value allows the client to reuse the same row over and over without having to release and recreate a new row.

In order to reuse rows, set the __Commit column value to 0x201 (Save with Reuse) after populating the column data for the row. If setting the __Commit column succeeds, the row column data can be re-populated and reused.

Similar to setting the __Commit attribute to 0, the Ignore value will not persist the data in the row but still allows the row to be reused.

The following table lists the valid values for the __Commit attribute, and provides a brief description of each.

Action Value Description
Discard 0x00 Discards the row.
Save 0x01 Saves the current row.
Flush 0x02 Flushes the buffers. Must be called on a row with only the __Commit column set.
Save and Flush 0x04 Saves the current row and flush the buffers.
Ignore 0x100 Makes the row non-persistent.
Reuse Row 0x200 Reuses the row multiple times without rebinding.


All rights reserved.