Forum Discussion

errad_27550's avatar
errad_27550
Icon for Nimbostratus rankNimbostratus
Mar 19, 2010

Bulk Operations

Hello,

 

 

I'm interested in doing bulk operations through IControl and I'd like to know what occurs when one or more of the objects in a bulk operation fail.

 

 

For example, suppose I send an Icontrol command 10 objects. If object 5 causes a failure, do I know 5 was the cause? Am I guaranteed that 1-4 completed successfully? Am I guaranteed that 6 wasn't issued?

 

 

Also, suppose 5 and 8 fail do I get an exception for just 5? Both 5 and 8? Any insight you can provide into how bulk operations are implemented would be greatly appreciated.

 

 

Thanks,

 

 

Eric

 

1 Reply

  • Eric, if you are making a single iControl call making a change on multiple objects, the server sits in a single transaction for all of the objects. If any of the operations fails, then all of them will be rolled back and you will receive the error for the first object there was a problem with.

     

     

    Essentially the server loop is like this in pseudo code:

     

     

    rc = SUCCESS 
     rc = begin_transaction 
     loop over object in objectlist 
     { 
       rc = do_operation_on_object 
       if ( rc != SUCCESS ) 
       { 
         break outer loop 
       } 
     } 
     if ( rc == SUCCESS ) 
     { 
       end_transaction; 
     } 
     else 
     { 
       throw OperationFailed exception based on rc. 
     }

     

     

    So, it will error out on the first error and only return you the details on that one. If 5 and 8 fail, the error will be based on 5.

     

     

    Hope this clears things up. If this doesn't make much sense, let me know and I'll try to clarify it.

     

     

    -Joe