Property Pooling
- Namespace
- YndigoBlue.Velocity.Data
- Assembly
- YndigoBlue.Velocity.dll
Pooling
Gets or sets whether connection pooling is enabled.
public bool Pooling { get; set; }
Property Value
Remarks
Connection pooling reuses database connections across multiple operations instead of creating a new connection for each request. This dramatically improves performance by eliminating the overhead of establishing new connections, which involves network round-trips, authentication, and initialization.
Performance Impact: Enabling pooling typically improves throughput by 10-100x compared to creating new connections for each operation. The benefit is most significant for applications with frequent database operations.
When to Disable Pooling:
- Unit Testing: Disable pooling during tests to ensure connections are truly closed between test cases, preventing connection state from leaking between tests.
- Debugging Connection Issues: Disabling pooling simplifies debugging by making connection lifecycle explicit.
- Very Short-Lived Applications: Applications that run for seconds and exit may not benefit from pooling overhead.
Recommendation: Leave pooling enabled in production. The performance benefits far outweigh any downsides for typical applications.