Reduce likelihood of inconsistencies in database and/or apiHolder
-
Remove isActive
flag and replace it with a table for a "this is the active user" entry that uses a foreign key to point to a specific user id -
Refactor apiHolder
switching so it gets done together with the active user switching -
Use db transactions to enforce consistency when switching apiHolder
and active user.