| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
IHP.Hasql.Pool
Synopsis
- usePoolWithRetry :: Pool -> Session a -> IO a
Documentation
usePoolWithRetry :: Pool -> Session a -> IO a Source #
Run a session on the pool, retrying on stale prepared-statement errors.
After schema changes (e.g. make db), pooled connections have stale caches.
hasql-pool auto-discards these connections, so retrying cycles through the
pool until a fresh connection is created. Retries are bounded to avoid
infinite loops if the error is persistent rather than transient.