Database Reference
In-Depth Information
Note The call to ExecuteParallelRoundRobinLoad is different in two ways from all the other methods you've
seen so far. First, there is no need to add the database GUID parameter; it creates this parameter automatically
with a NULL value. Second, this method executes on a List<SqlCommand> object instead of SqlCommand .
Figure 10-8 shows the sample application screen that creates the array of names to load in the
shard. Six names are added in the shard using round-robin, as previously described.
Figure 10-8. Sample application adding records using round-robin
Managing a Shard
Having created a shard and reached the point of being able to run queries and add data, you can begin
to think about higher-level issues: how to handle exceptions, manage performance, control transactions,
and more.
Managing Exceptions
So far, you've learned the basic principles of the sample shard library. You saw how to select, insert,
update, and delete records in various ways through the methods provided by the library. Let's discuss
how you can manage exceptions that the shard may throw at you.
The current library doesn't handle rollbacks, but it may throw exceptions that your code needs to
capture. In the previous example (Figure 10-8), all the records were inserted except Jim Nastic: that
Search WWH ::




Custom Search