We are currently creating wallets for all product categories in the system for all workspace. This happens due to calls such as walletbrowse triggers a wallet look up for each potential category. The look up contains a read or insert operation to the internal DB. However since the browse call does not care about the categories it ends up have all product categories as potential categories and therefore creates a wallet for each category.
I would suggest we make a alternative function for these calls and diferentiate between is this part of the creation of a resource (the wallet should be created) or is this an actually retieve and should only return what the workspace actually has and not create any wallets in that process.
It is specifically the lInternalWalletByOwner function that is responsible for this. We should back trace all usage of this function and split the need into
lInternalWalletByOwnerRead and lInternalWalletByOwnerReadOrInsert.
We are currently creating wallets for all product categories in the system for all workspace. This happens due to calls such as walletbrowse triggers a wallet look up for each potential category. The look up contains a read or insert operation to the internal DB. However since the browse call does not care about the categories it ends up have all product categories as potential categories and therefore creates a wallet for each category.
I would suggest we make a alternative function for these calls and diferentiate between is this part of the creation of a resource (the wallet should be created) or is this an actually retieve and should only return what the workspace actually has and not create any wallets in that process.
It is specifically the
lInternalWalletByOwnerfunction that is responsible for this. We should back trace all usage of this function and split the need intolInternalWalletByOwnerReadandlInternalWalletByOwnerReadOrInsert.