An inserter is not thread-safe. Individual threads should each obtain their own unique inserter instance, or must arrange for locking at a higher level to ensure the inserter is in use by no more than one thread at a time.
Objects written by an inserter may not be immediately visible for reading after the insert method completes. Callers must invoke either {@link #release()} or {@link #flush()} prior to updating references orotherwise making the returned ObjectIds visible to other code.
Use the same ObjectInserter for a single transaction
|
|
|
|