First attempt to write to database.