Enhancement: Start transactions only for writing activities
Fix: Added additional thread safety measures to SQLAlchemy instances