Suggestion: BlockExecutor method on Database class.

Andy_PSAndy_PS Posts: 16
Not a particually ground breaking change but it'd just be a bit cleaner being able to do

"liveDatabase.BlockExecutor(executionBlock);"

rather than

"blockExecutor.ExecuteBlock(blockExecutor, liveDatabase.ConnectionProperties.ServerName, liveDatabase.ConnectionProperties.DatabaseName, liveDatabase.ConnectionProperties.IntegratedSecurity, liveDatabase.ConnectionProperties.UserName, liveDatabase.ConnectionProperties.Password);"

:)

Comments

  • Oh and another one ;)

    The documentation says to dispose the Database and ExecutionBlock objects after use. It'd be nice if they implimented IDisposable so they can be put in using(){} blocks.
  • fordc03fordc03 Posts: 49 Bronze 2
    Andy_PS...I like the IDisposable request.

    I don't know that I like what you're thinking about the ExecuteBlock change though. :)

    I may not be done with the database object after invoking BlockExecuter. I will be done with the actual method and dispose of it when done, but then move on to some other audit checks that are in place that we perform against a database.

    If the change you're suggesting were to go through, then that means I'd have to hold that in my memory...we have some very large schema's that are about 135MB when loaded into memory and the block executer...would hold that unless I invoked some kind of "clear me" method. :)

    So...sorry...just an objectional user post from a nobody...take it for what it's worth I suppose... :)
  • fordc03fordc03 Posts: 49 Bronze 2
    I lied...I like it...except that instead of the way you put it...

    it would be more like:
                        ExecutionBlock block = work.ExecutionBlock;
    
                        BlockExecutor executor = new BlockExecutor();
    
                        executor.Status += new StatusEventHandler(ExecuteCallback);
                        executor.ExecuteBlock(block, db);
                        block.Dispose();
    

    Then the Executer could just check for username, password, integrated security, etc.
  • fordc03fordc03 Posts: 49 Bronze 2
    But I still like the old way because I can run the same execution block across hundreds of servers by just iterating through a list of databases and servers without creating new database objects.


    Okay...I'm done... :shock:
Sign In or Register to comment.