There is a separate instance of all data elements related to the database and current command processing state for each document. This includes the command processor, input processor, Visual LISP environment, databases, selection sets, and (most, but not all) system variables. The current command processing state is maintained in a heap. In addition to these built-in system elements, all ObjectARX applications must also maintain a document-specific state either on the stack or in structures on the heap that correspond to each active document.
Each document has its own current database, plus any number of xref databases and side databases. By default, a database is associated with one document, and it participates in the undo recording and playback for that document. However, databases may also be created independently of any document, in which case their undo state is either disabled or maintained by an application's custom undo facility.