create_eid: the function is recursive and may create hundreds of db connection on eid creation failure
The _create_eid
function is recursive. On DB failure, the db connection is unset, the function is recalled, and a new connection is created. If the function fails again, a new connection is created… and so on.
On a production application, we have seen hundreds of connection trying to increment the entity_idx_seq
.
May be the recursion should be limited (10 calls for instance), and a proper error should be raised whether no eid has been created when the limit is reached.