1. Correct, You cannot checkout the entire database, only per object
2. Element.CheckOut will apply to children only if they are compositionally referenced. In case of composition references, all elements in a composition are checked in/out together as one. Note that we do not generally recommend using composition, especially large compositions, because it has performance costs.
3. Yes, you can use Database.CheckIn to checkin multiple changes. You should generally use the method that takes the "AFCheckOutMode" - and pass either "ObjectsCheckedOutThisSession" or "ObjectsCheckedOutThisThread" so that you don't run into conflicts with other applications running under the same user identity (or in the same process if it is a multi-threaded process). You can also send a specific list of objects to checkin using PISystem.CheckIn(IList<AFTransactable>)
4. Yes, AFDatabase.UndoCheckout unchecks out everying the current user has checked out. You can also undo them one by one. AFDatabase.FindCheckedOutItems will give you the list of all items checked out.
5. Explictly invoking CheckOut is not required, but is sometimes useful..
a. If you want to ensure, prior to starting a series of changes, that you have access to all the elements you need. Once checked out, you will have a lock on the element which will prevent others from checking out.
b. It is possible to add elements to another element without checking out the parent element. However, in some cases, you may want the parent locked to prevent multiple applications from making simultaneous additions. In this case, checking out the parent specifically will allow for the exclusive access. It should be noted that for elements with large collections of children, this will slow down performance.
Many thanks Chris. This is helpful. Time to fix my code!!!