Premature backup when refreshing catalog

Posts   
 
    
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 25-May-2006 22:41:13   

When refreshing a catalog a backup copy of my project is made before the catalog refresh is started.

If there are no changes to the catalog, this backup remains. Could the backup be removed by the refresh process if no changes are found?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 26-May-2006 08:31:30   

That can't be determined unless every byte is compared in the catalog. The catalog object is part of the project, so it can be different while the entities show no changes because not all tables are mapped for example.

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 26-May-2006 12:44:07   

Why would a backup of the project be needed, if only the catalog part changed? The catalog changes can be recoved at any time by doing a catalog refresh.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 26-May-2006 13:01:41   

Because it can't make a backup afterwards. simple_smile You see, it refreshes the catalog first, in a new Catalog object. It then doesn't know if there are entities changed. Then it has to migrate all entities, typedlists etc. This is done in-place, not in a copy of the project. So after that work, it knows if there were changes or not. So to know if a backup has to be created, it first has to determine if there will be changes, and it therefore first has to do the migration.

So the only place to do a backup is before the migration, which it does.

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 02-Jun-2006 23:25:12   

Because it can't make a backup afterwards.

I've been thinking about this. - You have a copy of the project on disk. - You load it into th ui. - You are going to potentially make some changes (today you make the backup here) - You refresh the project. If there are changes, you copy the project that's on disk to a backup name. - When you save the changed (in memory) project, you overwrite the project on disk with the original name.

What am I missing?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 03-Jun-2006 09:24:15   

arschr wrote:

Because it can't make a backup afterwards.

I've been thinking about this. - You have a copy of the project on disk. - You load it into th ui. - You are going to potentially make some changes (today you make the backup here) - You refresh the project. If there are changes, you copy the project that's on disk to a backup name. - When you save the changed (in memory) project, you overwrite the project on disk with the original name.

What am I missing?

Well, the sole thing I want is that every potential change is covered by a backup. So I make that up front. I won't rely on check code which might not report a change because it's not important to you. I won't add a lot of extra code just to see if there are bits changed (all relations are re-created for example) just because an automatic backup has to be done differently. The code that's in, works in 100% of the cases, why change that for something which can make errors ? I don't see the benefit of that.

Frans Bouma | Lead developer LLBLGen Pro