Work class question

Forum for users of SQL Toolkit 3,4,and 5

Work class question

Postby ilya » Wed Jul 30, 2008 10:05 am

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;).
ilya
 
Posts: 13
Joined: Wed Jul 30, 2008 9:28 am

Postby Brian Donahue » Fri Aug 01, 2008 6:29 pm

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!
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby ilya » Tue Aug 05, 2008 8:54 am

Hi Brian, thank you! it has helped! :)
ilya
 
Posts: 13
Joined: Wed Jul 30, 2008 9:28 am


Return to SQL Toolkit Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest