Add to show exception information when the number of parameters are not the same as arguments.
Added a code to use a backup(persistent) db file and working db file. This may help to avoid corrupting db file because of crash. If there is a crash, restore from backup file. And close HAEntityManager is called correctly, backup file is updated.