My Nestjs app & another codeigniter php app are connected to a common database. In NestJS whenever I query some row which was previously updated by the Codeigniter app, I'm not getting the latest value. I'll get the latest value once I restart the NestJS app. I think some db level lock is causing this issue. Any help is appreciated.
My Typeorm config
TypeOrmModule.forRootAsync({
inject: [ConfigService],
imports: [ConfigModule],
useFactory: async (
configService: ConfigService,
) => {
const dbConfig = configService.get<MysqlConfig>('mysql');
return {
autoLoadEntities: true,
type: 'mysql',
host: dbConfig.dbHost,
username: dbConfig.dbUsername,
password: dbConfig.dbPassword,
database: dbConfig.dbName,
port: dbConfig.dbPort,
synchronize: true,
subscribers: [],
dropSchema: false,
cache: false,
logging: dbConfig.logging,
migrations: [join(__dirname, 'migrations', '*{.ts,.js}')],
};
}
})