Laura10101 / contractor-tax-calculator

0 stars 2 forks source link

Deleting entities results in a database error: too many connections #213

Open Laura10101 opened 9 months ago

Laura10101 commented 9 months ago

When a significant number of questions, rules or tiers have been added against a single jurisdiction, ruleset, or rule respectively, then deleting an entity causes the following error:

FATAL: too many connections for role "mqrlkcwy"

Laura10101 commented 9 months ago

Deleting any of the objects above causes rulesets to be resequenced. This involves updating the ordinal on each question which was not deleted to ensure they remain sequential. Each request is sent asynchronously, allowing for multiple requests to be sent in parallel. Consequently, where there is a large number of entities to be resequenced, the number of requests sent in parallel may exceed the number of allowed connections.