added code to do transaction for some static operations.

In general, SQLite3 becomes slow without transcation. So we add
statements for it.