If you want to use transactions, you must create an NSMemDbConn object. In general, when you create an object, the object exists in memory. The object is not placed in the database until it is explicitly inserted. An insert operation fails if you do not set all of the non-default values. After an object has been inserted in the database, the record can be retrieved by a query operation.
Many classes also support retrieval of individual records by unique key value.
Typically, you cannot insert or update a record in the database until you change at least one field in the object. You use access methods to get and set the value of a field. Most classes follow state-transition rules for accessing the database. If you implement a class that access the database, you should follow the protocol for state transitions. Note that the NSProduct class does not implement the protocol at all.