正解:A
The best way to ensure that an Account is not created if the creation of the Contact fails is to use setSavepoint() and rollback() with a try-catch block. This way, the developer can mark a point in the transaction before inserting the Account, and then catch any exception that occurs when inserting the Contact. If an exception is caught, the developer can roll back the transaction to the savepoint, which will undo the insertion of the Account. Using the Database.insert method with allOrNone set to false will allow partial success, but it will not prevent the creation of the Account if the Contact fails. Using the Database.delete method if the Contact insertion fails will delete the Account, but it will consume an extra DML statement and might cause other side effects. Disabling validation rules on Contacts and setting default values with a trigger will not ensure the creation of the Contact, and might compromise the data quality and integrity. Reference: [Savepoints and Rollbacks], [Database Class], [Apex Developer Guide]