Add mutex to protect task node refs.
Add some method to manage db conn resources.