Summary
DbConnection defines a StateChange event that should be raised whenever the connection transitions between states (Closed → Open, Open → Closed, etc.). The FileConnection classes change the State property directly without raising this event via OnStateChange().
What's Needed
Call OnStateChange(new StateChangeEventArgs(oldState, newState)) whenever State changes in:
Open() — Closed → Open
Close() — Open → Closed
ChangeDatabase() — if state transitions occur
- Error scenarios — any transition to Broken state
Impact
Code that subscribes to StateChange (e.g., connection lifecycle logging, ORM frameworks, monitoring tools) will never receive notifications.
Standard Reference
Summary
DbConnectiondefines aStateChangeevent that should be raised whenever the connection transitions between states (Closed → Open, Open → Closed, etc.). TheFileConnectionclasses change theStateproperty directly without raising this event viaOnStateChange().What's Needed
Call
OnStateChange(new StateChangeEventArgs(oldState, newState))wheneverStatechanges in:Open()— Closed → OpenClose()— Open → ClosedChangeDatabase()— if state transitions occurImpact
Code that subscribes to
StateChange(e.g., connection lifecycle logging, ORM frameworks, monitoring tools) will never receive notifications.Standard Reference