How can we help you today?
Parallel.Foreach and VistaDB
I'm going to assume you've simplified the problem down so some of this feedback may not be valid (since it may not apply to your full example). My first question is why are you doing the explicit transaction? A single DML statement in VistaDB is implicitly a transaction, but when wrapped in an explicit transaction the engine has to do a lot more work under the covers - about double the work - and it notably increases the locking effort. If your data updates don't really require a transaction to ensure atomicity between multiple DML statements I'd recommend removing the explicit transaction and see how that changes the results you're seeing.
I'm aware of the extra overhead for transactions, and know this may impact performance. The major issue here is the error message generated by VistaDB, is this something you can help us with ?
Sure. We'll have to evaluate whether this is a transient error that shouldn't be thrown or a case where we're encountering a lock timeout and just not throwing the correct exception. We'll dig into it.
We have run into an issue that happens now and then related with our web service. I have reproduced the error by using the .net "Parallel.ForEach".
When not running that many parallel db updates (less then 10) it works, with really bad performance. Increasing the parallel db updates it will get an "..The process cannot access the file because another process has locked a portion of the file."
Please advise use VistaDB using Parallel.Foreach and how to increase performance on Parallel.Foreach.
(There are really many lock-files being created on db update process.)
Thanks and happy new year to you all :)