Minor performance: find and save factories in the constructor
Performance: cache generators per statement/database combination