Replies: 1 comment
-
I've commented the line where "Maximum number of transactions reached" exception is thrown and I made some tests with 100000 reads and 100000 inserts all in parallel and seems to be everything OK. In one test I've started 200000 Tasks in parallel and in the second test I've used "Parallel.Invoke(Action)" to start 200000 parallel thread and the exception was not thrown anymore. Also after tests I've verified the data inserted in the database and is all there and nothing was corrupted. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a problem with transactions limit and I've seen in the source code that the transaction count is limited to 100. The problem is that my code read and write in the database from async functions and this can not be changed.
Will be any problem if I delete this limit or if I increase it? Or maybe is better to use SemaphoreSlim inside TransactionMonitor to not open more than 100 transactions in the same time?
In 99% of the cases will be only 1 or 2 Tasks that need something from the database, but sometimes I have peeks and I do not want to cancel the Tasks. I mean that is OK for me to put the Tasks in sleep for some time until I can open a new transaction, but I do not want to have an error that cancel the Task and to lose the data associated with that Task.
Edit: Can somebody tell me the reason for why the transactions count is limited to 100?
Beta Was this translation helpful? Give feedback.
All reactions