-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sqlite wallet issue #299
Comments
The issue is many requests at the same time. If you request the balance in the browser and keep refreshing, it will quickly begin crashing. Example: http://localhost:33333/api/wallet/balance?walletName=main&accountName=account%200 |
does SQLite doesn't support multiple access to db? |
is it based on Dapper? |
I checked fast, it seems dapper is used in WalletStore that is created once for each wallet, this mean it's a shared instance and since WalletStore create teh db connection in its constructor, that's the problem in EF the dbcontext should be short living (like a unit of work), I suppose the same should be done on Dapper? |
I think dapper opens and closes the connection internally, I am not sure it needs to be short lived, but that's a place to look yes. |
But I am pretty sure the wallet has locks on it before even reaching the wallet store |
it doesnt, look the method pointed out by @sondreb, you'll find a loop that calls address.GetBalances, if you follow it you'll see there are no locks |
- This is the smallest impact and quickest way to fix the issue with connections against sqlite database. - Closes #299
…ct (#300) * Make sure that each query against database uses a new connection object - This is the smallest impact and quickest way to fix the issue with connections against sqlite database. - Closes #299 * fix memory conn * Ensure all calls to GetDbConnection is wrapped with using clause * Update version for release 20 * Minor additional improvements on connection usage Co-authored-by: SondreB <sondre@outlook.com>
Change to RELEASE mode, run any node, create a wallet and query for address.
This will fail
The text was updated successfully, but these errors were encountered: