XmlManager::getDefaultSequenceIncrement

API Ref

#include <DbXml.hpp>

void XmlManager::setDefaultSequenceIncrement(u_int32_t increment)

u_int32_t XmlManager::getDefaultSequenceIncrement()


Description: XmlManager::getDefaultSequenceIncrement

Sets the integer increment to be used when pre-allocating document ids for new documents created by XmlContainer::putDocument.

Every document added to an XmlContainer is assigned an internal unique ID, and BDB XML performs an internal database operation to obtain these IDs. In order to increase database concurrency and improve performance of ID allocation, BDB XML pre-allocates a sequence of these numbers. The size of this sequence is determined by the value specified here. The default ID sequence size is 5.

Be aware that when a container is closed, any unused IDs in the current sequence are lost. Under some extreme cases, this can result in a container to which documents can no longer be added. For example, setting this value to a very large number (such as, say, 1 million) and then repeatedly opening and closing the container while adding a few documents will eventually cause the container to run out of IDs. Once out of IDs, the container will never again be able to accept new documents. The maximum number of IDs that a container has available to it is currently 4 billion.

You should almost always leave this value alone. However, if you are loading a large number of documents to a container all at once, you may find a small performance benefit to setting the sequence number to a larger value. If you do this, be aware that this value is persistent across container opens, so you should take care to reset the value to its default once you are done loading the documents.

Parameters

increment
The increment to use for pre-allocated IDs.

APIRef

Copyright (c) 1996,2007 Oracle. All rights reserved.