use a transaction to save records
Merge pull request #902 from tchak/schedule-save

use a transaction to save records