Make database connections persistent for performance benefits
Fix for incorrectly encoded entities