The errors returned by DBMS functions are mostly documented with those functions, but this document summarises some of the more common/general errors.
The Store database makes full use of file store functionality, and any errors produced by CPermanentFileStore, its stream objects and particularly the underlying file system may be returned by a DBMS function where indicated. Also many of the functions require memory to be dynamically allocated, and so can fail with KErrNoMemory.
The errors returned by DBMS functions are mostly documented with those functions. There are a few general errors which can be returned by most of the API to indicate certain states that the database or rowsets have encountered.
KErrAccessDenied - The database cannot mix data definition and data manipulation, or combine them in a single transaction. i.e.
A rowset or data manipulation transaction is open on the database when attempting data definition or recovery.
A data definition transaction is still open when attempting to create a rowset.
Any incremental operation is open on the database.
KErrDied - A transaction has been aborted, because an update or commit failed. In this state, the database and all associated rowsets become unusable. In this situation, all rowsets which are currently updating or inserting a row must be cancelled, and, if the transaction was begun explicitly, it must be rolled back. The database is now ready for use again.
KErrNotReady - This is returned by all rowsets following a rollback on the database. The rowset is invalid and must at least be reset and re-evaluated if necessary, but can be closed and re-opened if preferred.
KErrCorrupt - This is returned when an attempt is made to use an index which has been damaged due to a rollback. Rowsets which were using such an index fail on the first attempt to navigate their cursor. The database continues to be operational, but must be recovered to regain use of damaged indexes.
This can also be returned in the unlikely event that corruption is detected in any of the streams which make up the database. Such damage cannot have been caused by DBMS itself, and cannot be repaired.