Microsoft SDK for Java

Commit

This method of the IStorage interface ensures that any changes made to a storage object open in transacted mode are reflected in the parent storage; for a root storage, reflects the changes in the actual device, for example, a file on disk. For a root storage object opened in direct mode, this method has no effect except to flush all memory buffers to the disk. For non-root storage objects in direct mode, this method has no effect.

Syntax

public void Commit(int grfCommitFlags);

Return Value

S_OK -- Changes to the storage object were successfully committed to the parent level. If STGC_CONSOLIDATE was specified, the storage was successfully consolidated, or the storage was already too compact to consolidate further.

STG_S_MULTIPLEOPENS -- The commit operation succeeded, but the storage could not be consolidated because it had been opened multiple times using the STGM_NOSNAPSHOT flag.

STG_S_CANNOTCONSOLIDATE -- The commit operation succeeded, but the storage could not be consolidated due to an incorrect storage mode. For compound files, the storage may have been opened using the STGM_NOSCRATCH flag, or the storage may not be the outermost transacted level.

STG_S_CONSOLIDATIONFAILED -- The commit operation succeeded, but the storage could not be consolidated due to an internal error (for example, a memory allocation failure).

E_PENDING -- Asynchronous storage only: Part or all of the data to be committed is currently unavailable.

STG_E_INVALIDFLAG -- The value for the grfCommitFlags parameter is not valid.

STG_E_INVALIDPARAMETER -- One of the parameters was not valid.

STG_E_NOTCURRENT -- Another open instance of the storage object has committed changes. As a result, the current commit operation may overwrite previous changes.

STG_E_MEDIUMFULL -- No space left on device to commit.

STG_E_TOOMANYOPENFILES -- The commit operation could not be completed because there are too many open files.

STG_E_REVERTED -- The storage object has been invalidated by a revert operation above it in the transaction tree.

Parameters

[in] grfCommitFlags Controls how the changes are committed to the storage object.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.