#1 2015-01-02 18:26:43

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Breaking change after my return

I had nothing else to do in the last two months, so I could not follow the development of the project.
I have 2 projects where I use the mORMot framework, I have try to compile them with last version of framework. I think and I hope to have update right my code but I have a problem, how I must replace

Database.EngineExecute('VACUUM');

where Database is a TSQLRestClientURI in first project and TSQLRestClientDB in second project?

Is right use:

DatabaseServer.DB.Execute('VACUUM'); // on first project (DatabaseServer is TSQLRestServerDB);
Database.Server.DB.Execute(''VACUUM'); // on second project

Last question, the first project need of database backup function, so I have replaced this code:

Stream := TFileStream.Create(Folder + NewName + '.cbbak', fmCreate);
try
  Stream.Seek(0, soFromBeginning);

   DatabaseServer.Backup(Stream);
finally
  Stream.Free;
end;

with this

DatabaseServer.DB.BackupBackground(Folder + NewName + '.cbbak', 1024, 0, BackupProgressEvento);

DatabaseServer.DB.BackupBackgroundWaitUntilFinished;

Is my new code right or need of some fix?

Thanks

Offline

#2 2015-01-02 18:31:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,662
Website

Re: Breaking change after my return

??? I do not understand the VACUUM trick. Why use a double quote? Your line won't compile.
In all cases, such VACUUM is not to be run on the client side. New security policy would disallow it, for safety.
You can use DatabaseServer.DB.Execute() on server side safely, of course.

About the backup feature, the previous implementation has been found unstable, so has been removed to the knew background process.
IMHO you can use BackupBackground() directly, without using BackupBackgroundWaitUntilFinished, on the server side.

Offline

#3 2015-01-02 19:25:57

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Re: Breaking change after my return

The "double quote" is a error. I'm not copy the code but rewrite it on post and then I have put a double quote.

Thank you fot this and for your great job.

Offline

Board footer

Powered by FluxBB