Force transaction commit before fetching data. Function to count the number of stored results.