* Fix a bug in releasing connection with transaction.
* Minor fix/enhancement when destroying the factory