Red Gate forums :: View topic - Work class question
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Toolkit Previous Versions
SQL Toolkit Previous Versions forum

Work class question

Search in SQL Toolkit Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
ilya



Joined: 30 Jul 2008
Posts: 13

PostPosted: Wed Jul 30, 2008 10:05 am    Post subject: Work class question Reply with quote

Hi! Should I dispose Work.ExecutionBlock after using of Work object, if I didn't use the executionBlock property?

I use a Work object to get Warnings and Sqlsqript(via ScriptObject).

But from the docs is not clear, if an object of executionBlock is also created with the Work object and should be disposed
or
it will be created only if Work.ExceutionBlock property will be used (if I write ExecutionBlock eb = work.ExecutionBlock;).
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Fri Aug 01, 2008 6:29 pm    Post subject: Reply with quote

Hi Ilya,

I'd say no, because the ExecutionBlock doesn't contain any data unless Work.BuildFromDifferences is run. It may be important to run Dispose() on the ExecutionBlock when it has been populated, because ExecutionBlock could potentially leave large SQL script files in your temporary files folder that really should be cleaned up.

So I would say that unless you had previously run BuildFromDifferences on the Work object, you wouldn't need to dispose the ExecutionBlock.

I hope this helps!
Back to top
View user's profile Send private message
ilya



Joined: 30 Jul 2008
Posts: 13

PostPosted: Tue Aug 05, 2008 8:54 am    Post subject: Reply with quote

Hi Brian, thank you! it has helped! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group