Change Database Structure

Posts   
 
    
xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 02-Feb-2015 00:26:43   

I'm using LLBLGen4.2 for Oracle, Adapter. My scense is use LLBLGen with WCF. So the DBGeneric project in client side, and server side use both DBGeneric and DBSpecific projects. I have an "OLD" client connect server, now I prepared develop a "New" client which need change the database structure. All the changes is "Add" not "Delete",not "Modify",such as add columns,add tables,add views, add procedures and so on. For this, I need to open designer, refresh the Relation Data Model and regenerate codes, and recompile my solution,and republish my server side and the "OLD" and "NEW" client. But my customer's requirement is the "OLD" client and the WCF service shouldn't stop running even one second. So I can't republish the "OLD" client and the server, I can only do something on the "NEW" client. May be then "OLD" client should be called "OLD" products.

What I want to ask is: is there a solution to develop a "Common" wcf service which can service for old products and new products without need to republish. Once I do "Add" changes to my database structure to fit my new products, I just need to republish my new products, the old products and the service will work all the time?

I have a idea is my client just generate raw sql statement and pass sql to service, and the service just execute sql statement and return the result to client. So the service is "Common", database structure changes will not influence it. But I also want take advantage of LLBL, so the best solution is there is two Adapter, one in client side to generate sql, another in server side to execute sql.

Maybe there are better solutions,please help me

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 02-Feb-2015 08:03:43   

I can think of a couple of solutions:

A) Leave the OLD client and redeploy your server. Since you just did 'Add' operations to your schema, it should work. The SQL statements will emit just the columns know by the OLD DBGeneric project (so less columns and tables). You then should elaborate a translation between your NEW entities and the OLD ones, so you WCF can return always the OLD ones.

B) Version your service. You can do something like: www.mycompany/myservice/v1 www.mycompany/myservice/v2 The v1 version is the old server and requires the OLD client. The v2, on the other hand will be the new server and would require the NEW client (new DBGeneric). So your clients should decide whether to upgrade or not.

C) Use DTOs. This is kind of the same as option (A), but it's a more 'common' playground, and you can always mix it with the option (B). A translation is needed though.

David Elizondo | LLBLGen Support Team
xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 02-Feb-2015 09:51:33   

And what about the raw sql solution? Is there any way to genere raw sql, and send the raw sql to server, and receive result from server, and continue the rest logic of DataAccessAdapter? If so, I can create a 'COMMON' server, no matter what changes to the db.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 02-Feb-2015 20:45:29   

I'm not sure why you want to send raw sql from the client to the server. I think this defies the concept of ORM.

I recommend option b from the above.

xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 03-Feb-2015 02:09:49   

OK,I'll take B,thanks.