Skip to content

Commit ac7ca0b

Browse files
authored
[FDC] Fix the transaction hang bug with pglite (#9771)
* changelog * comment * comment
1 parent 40df2d6 commit ac7ca0b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix the bug when Data Connect emulator hangs with PGlite. (Issue #9756) #9771

src/emulator/dataconnectEmulator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ export class DataConnectEmulator implements EmulatorInstance {
333333
connectionString: connectionString.toString(),
334334
database,
335335
serviceId,
336-
maxOpenConnections: 1, // PGlite only supports a single open connection at a time - otherwise, prepared statements will misbehave.
336+
// NOTE: Previously, we set `maxOpenConnections: 1` to get around PGlite's limitation with prepared statements.
337+
// Since we switched emulator to avoid prepared statement, multiple connections are OK.
338+
// Transactional operations (`mutation @transaction`) actually requires multiple connections.
337339
});
338340
this.logger.logLabeled(
339341
"DEBUG",

0 commit comments

Comments
 (0)