I have a VF page which dynamically inserts records into a custom object. To debug the problem and ensure the records have been successfully, I reloaded the inserted records after the insertion. The records were there and could be reloaded into another variable. However, I cannot find the records in the object using Cloudingo Studio. I have also tried to retrieve the previous records by relaunching the VF page again and they were found no longer there. It seems that the records inserted have their lifespan only within the current page. But no DML exception is caught and no rollback has ever been executed manually. Is there anybody can enlighten me on the problem? Thanks.
Sample code likes this:
try {
Database.insert(recordRow);
}
catch {
return null;
}
List<Issue__c> readAgain = [SELECT Name FROM Issue__c WHERE Id =: recordRow.Id LIMIT 1];
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, readAgain[0].Name));