Query on Refresh relational model data from database

Posts   
 
    
doshikn
User
Posts: 32
Joined: 04-Jun-2013
# Posted on: 04-Jun-2013 16:09:47   

Hi,

There are multiple people working on same GenPro project at one point on different views in same database. Everyone is working in their own areas modifying their respective views. They are still under unit testing and they do not want to check-in.

However, when I refreshes the relational model (Right click on my DB connection in Catalog Explorer), I get changes related to others views also.

For example,

  1. A modified view1_VW
  2. B modified view2_VW
  3. C modified view3_VW <- Its me

Now, when I refresh my relational model I want only view3_VW to be refresh and not for others.

I want only my view to be refresh and not all. Is there any way I can refresh only single view at one point and generate source code.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Jun-2013 20:10:49   
doshikn
User
Posts: 32
Joined: 04-Jun-2013
# Posted on: 04-Jun-2013 20:30:47   

I do not think we can have seperate DB for each developer. That will be very difficult to merge the code later when we have a huge application.

There should be something through which I can refresh only my view from DB in Catalog Explorer or Project Explorer.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Jun-2013 21:13:09   

How are you merging or synchronizing the access to the LLBLgen project? Is it in a source control? Are you using an exclusive access to it, or everyone can edit it and then merging is done later?

Frankly I don't see an issue if you refresh the database, and find out there are couple or more new views have been created, even if the llblgen project is not updated, yet.

Anyway, havng more than one developer changing the database schema (even if it's just views) at the same time without any kind of source control, and/or separation is not the best practice.

So if merging what each of them is doing is difficult, then it seems they are not working on separate Views after all.

Otherwise, merging the database creation/update script wouldn't be an issue at all.

This should come in-sync with checking in and merging the llblgen project as well as the application code.

doshikn
User
Posts: 32
Joined: 04-Jun-2013
# Posted on: 07-Jun-2013 13:33:39   

It is the source control which we are using to check-in all our code and project.

However, the issue is when we refresh the llbl genpro project, one gets all the updated views which he is not working on but the others are working. And others who are working have not completed yet but are under testing phase.

So as I mentioned earlier, person A has completed his work and is ready to generate source code but not the person B and person C. Person B and C might have done their changes to views temporarily for testing their work.

Is there a way that person A is able to refresh genpro project only for his view and not B and C.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Jun-2013 07:53:58   

doshikn wrote:

Is there a way that person A is able to refresh genpro project only for his view and not B and C.

When person A refresh the catalog, he can uncheck the B's and C's views so they are not imported. But if you already have B's and C's views in the project and you just want to ignore the DB changes, that's not possible. This ensure that your project is in sync with the DB.

David Elizondo | LLBLGen Support Team
doshikn
User
Posts: 32
Joined: 04-Jun-2013
# Posted on: 08-Jun-2013 08:24:41   

I think it should be included in as a new feature (may be on demand - User preference checkbox). This is required because at times their are possibilities that DB has n number of views and I do not want to refresh all views but only selected views. This also saves lots of time while I am refreshing my RDBMS especially remotely.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39912
Joined: 17-Aug-2003
# Posted on: 08-Jun-2013 12:14:59   

doshikn wrote:

I think it should be included in as a new feature (may be on demand - User preference checkbox). This is required because at times their are possibilities that DB has n number of views and I do not want to refresh all views but only selected views. This also saves lots of time while I am refreshing my RDBMS especially remotely.

That might make sense at that point, but it actually doesn't: what does the generated code represent? Say, you refresh 10 views, and leave 90 as-is. You generate code, but that generated code contains e.g. entities mapped onto 90 views which might not work for you, as the views might have changed in the DB but you didn't refresh them.

If you repeat that cycle a couple of times, you can't know what will work and what will not: the views (and tables) in the DB might be totally different from the meta-data you have in your project as you haven't refreshed those in a while. Using the generated code on those views then will make no sense: it will likely crash. That's why we keep things in-sync with the DB if you work database-first: if things aren't in sync, you can't predict what will work and what will not work when you use the generated code. So running the tests will perhaps not work out, but if they fail, why will that be? Because the mappings/class is wrong, or because the view isn't there anymore or changed? Unclear.

You all use different code bases for your own code, or are you also all working in the same code base? This is important, because if you all use your own code base (e.g. your own typedview classes, I don't know which framework you're using), you can merge that later on and e.g. use your own llblgenproj project with just the views you use. Did you investigate whether that is a solution?

Frans Bouma | Lead developer LLBLGen Pro
doshikn
User
Posts: 32
Joined: 04-Jun-2013
# Posted on: 08-Jun-2013 21:02:15   

Eventually what you are saying is true, as I would not like that 10 views are refreshed and 90 remains it as is. So I was expecting to be a feature as user preference or on demand feature which will help me and even does not break any code for other developers. The one who is working on their views would definately not miss to refresh his views and check-in his changes, hence finally all 90 views will also be taken cared off into the source control.

Yes we all work on the same code. As you mentioned we work on individual basis on own llbl genpro project. Would that be possible to merge all genpro project later on, as everyone will have their own project/views and we want to be everything into the source control, even genpro project.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39912
Joined: 17-Aug-2003
# Posted on: 09-Jun-2013 13:07:22   

doshikn wrote:

Eventually what you are saying is true, as I would not like that 10 views are refreshed and 90 remains it as is. So I was expecting to be a feature as user preference or on demand feature which will help me and even does not break any code for other developers. The one who is working on their views would definately not miss to refresh his views and check-in his changes, hence finally all 90 views will also be taken cared off into the source control.

But I was referring to you as a developer, working on those 10 views simple_smile Your code, if it interacts even a tiny bit with the 90 views which aren't refreshed, you might run into issues in your tests, because the 90 views in the DB aren't in sync with the 90 classes / mappings you work with.

Yes we all work on the same code. As you mentioned we work on individual basis on own llbl genpro project. Would that be possible to merge all genpro project later on, as everyone will have their own project/views and we want to be everything into the source control, even genpro project.

You can import elements/mappings from one llblgenproj project into another: http://www.llblgen.com/documentation/4.0/Designer/hh_goto.htm#Functionality%20Reference/ImportSystem.htm#importing

There's one caveat: meta-data for views can't be imported. But this isn't a problem: if you first read the metadata from the database in a project (so all views are in the catalog information), then import the typedviews (or entities) mapped onto them, the mappings will be imported as well.

Just try it with an empty project, into which you first read the relational model data of the DB, and then import all the typedviews (or entities) mapped onto the views from 1 or more llblgenproj files.

Importing works only in the standalone designer, if you're using v4, it won't work in the integrated designer in vs.net, as vs.net doesn't allow an add-in to create a separate appdomain.

Frans Bouma | Lead developer LLBLGen Pro