Using CSLA to move data from one database to another

Using CSLA to move data from one database to another

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


jfreeman posted on Thursday, January 10, 2008

I have a potential project where the application will connect to a Pervasive database, read some data from 2 -3 tables, manipulate the data and then write the new information to a 1 or 2 tables on a SQL 2005 database.  Is that something that can be done using CSLA?  I am still new to the framework and want to try to use it on this project if it is feasible.  Thanks.

Jonathan

Marjon1 replied on Friday, January 11, 2008

There shouldn't be any problem with this, the fetch and insert methods are completly independant of each other and the framework is not tied to a single database.

As long as you can get the information you want from the Pervasive database and manipulate it to match what it needs to be for you object. You can then program your DataPortal_Update or DataPortal_Insert method to connect to SQL database and insert the records. The biggest issue you may run into is mapping any form of foreign keys.

This actually has given me a different look at doing a simple import. Will eagerly see if others point out any potentional reasons for not doing this.

John

JoeFallon1 replied on Friday, January 11, 2008

I do stuff like this all the time for importing data from text files or Excel spreadsheets or external databases. I like the idea that the BO gets "filled in" and then validated for each record and then can be saved to my real DB. If a record is invalid, the fact is logged and then the next row is imported anyway. This gets the majority of the "good data" out of the file and into the DB. Then the user can review the log for exceptions and only re-submit those records in a new file.

Joe

 

jfreeman replied on Friday, January 11, 2008

So would I built one BO to pull the data and another BO to insert the data?  Or would it all be handled in one BO?

Jonathan

 

meierk replied on Friday, January 11, 2008

Jonathan,

You don't indicate any specifications such as whether this is a one-off load, run on demand or a job that will be regularily scheduled, so the short answer is yes you can use CSLA.

My personal view is that if you are moving bulk data with simple transformations, you should use products that are specifically designed for just that.  Sure you could use CSLA or any other framework (SubSonic is great for this), but in your case since you are using SQL Server 2005, have you considered SSIS?

Kevin

praevsky replied on Friday, January 11, 2008

Assuming SQL Server 2005, the answer is unequivocally SSIS. 
One-time or run on demand. 
With SSIS available, CSLA cannot even be considered for data loading.

ajj3085 replied on Friday, January 11, 2008

I'm not sure I agree.  I'd think you can use Csla in combination with SSIS, and if it's more than a one time load and business rules must decide if the data should be loaded or not, I would think that leveraging Csla as part of the package could be helpful.


Copyright (c) Marimer LLC