Replies: 3 comments 1 reply
-
I just found that there is a wiki about this plugin...let me sink in... |
Beta Was this translation helpful? Give feedback.
-
You should use the public void Execute(IServiceProvider serviceProvider)
{
var orgServiceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
var orgSvc = orgServiceFactory.CreateOrganizationService(Guid.Empty);
using (var con = new Sql4CdsConnection(orgSvc))
using (var cmd = con.CreateCommand())
{
cmd.CommandText ="...";
}
} As you say, parallel use of the organisation service is not permitted in a plugin and SQL 4 CDS will execute all commands without any parallelism in this case. |
Beta Was this translation helpful? Give feedback.
-
I see you've opened an issue on this as well, so I'll close this and answer on #379 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi I have come across this amazing tool / library and I am shocked! This tool is so useful and i can't wait to integrated into my own plugin to use to quary my dataverse environment!
But some technical details aren't clear and I am wondering if I may ask here:
1, can this be integrated into our own c# plugin for dataverse? I am image i just need to include NuGet package into my solution and I can reference this library's method using keyword new Sql4CdsConnection(connectionString) directly in my plugin, and once i register the plugin it will work as intended right? In terms of details code i believe it can be work out by intellisense...which isn't hard.
2, the hard part is, as i need to write a plugin in post operation synchronous mode, I wonder if this will be conflict with sql4CDS's parallel feature? Below is the implementation i would like to do:
So the key question is, how can i configure BatchSize and MaxDegreeOfParallelism properties to let Sql4CDS to run each quary in parallel? so to improve plugin run time? As far as I know parallelism isn't allowed inside the context of one plugin? My plugin won't need to process anything after the SQL4CDS plugin, once the SQL4CDS plugin start running, I would like it to execute in parallel, and once complete, the whole plugin process is ready to be ended and exit. Below is a short implementation i would like to do:
The user do not need to see the result immediately, instead, release of the user's client interface ASAP is crucial, and then the user can manually refresh the page to see the result.
So, I would like to know how to implement this? any thoughts and how to make parallel call inside a plugin's context?
Thank you Mark! Amazing tool it is!
Beta Was this translation helpful? Give feedback.
All reactions