Batch processing

Batch processing

Old forum URL: forums.lhotka.net/forums/t/1721.aspx


Ambroski posted on Wednesday, November 08, 2006

I'm working on a project where I need to do a batch processing on a database. Do I have to call the stored procedure from the BatchProcessing client?

Anybody got a sample code?

Bayu replied on Thursday, November 09, 2006

Hello,

It all depends on what your requirements are. Usually, you would prefer to run batch processes overnight, i.e. when the performance hit is least likely to affect your users. For this purpose you would write a Windows Service program that runs in the background on your server, every night it will do its work for you and put the results somewhere where you can pick it up the next morning and perhaps also send an email of successfull completion.

If on the other hand you need to allow your users to trigger these processes and basically your batch process is a synchronous operation like regular db queries, then it would be implemented like any other db query in csla. A subclass of the CommandBase object is probably the object of your choice to get the job done.

Whether you use stored procs or dynamic SQL is up to you. You could spawn a new thread on just this topic alone, whatever works for you is fine. In general, stored procs could be favoured for (slightly) better performance and the fact that they can be maintained/tuned independently of your code. On the other hand, creating SQL statements in your code and allows for much more flexibility.

Regards,
Bayu

Copyright (c) Marimer LLC