#1 2017-11-07 18:31:03

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Sqlite3 busy error when update main DB from OnUpdateEvent

Hi @ab,

I have the secBusy error (code = 5) when storing in a local SQLite3 table (no external mapping) the notified changes in OnUpdateEventLog and the system is under high load. The local table it is in the main REST server together to external tables. I need notify to an third party external process the changes on some tables. Is there another way ?

Any suggestion I will appreciate you.

TIA.


Esteban

Offline

#2 2017-11-07 18:38:21

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

Re: Sqlite3 busy error when update main DB from OnUpdateEvent

The current Sqlite3 use in mORMot expects exclusive access on the physical file.
Ensure a single process and thread open the Sqlite3 local file.
Then you shouldn't have any secBusy error.

Offline

#3 2017-11-08 13:25:49

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: Sqlite3 busy error when update main DB from OnUpdateEvent

Thanks @ab, I see that TSQLRecordHistory can compliance my requirements but I would need that the record ID and the table name fields exists explicitly in the table, this is for external services that can read and delete the records. Can you add this fields ? I really would appreciate this feature.

Thanks.

Last edited by EMartin (2017-11-08 13:31:57)


Esteban

Offline

#4 2017-11-08 14:23:18

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: Sqlite3 busy error when update main DB from OnUpdateEvent

@ab with TSQLRecordHistory the error still persists, how I must to configure the TSQLRestServerDB for ensure a single process open the associated SQLite3 database ? I have to define all "AcquireExecutionMode" to same value ? What would be those value ?

Sorry for many questions but I am confusing.

Thanks.


Esteban

Offline

#5 2017-11-08 14:39:05

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

Re: Sqlite3 busy error when update main DB from OnUpdateEvent

You can get this from ModifiedRecord field, e.g. via TSQLRecordModification.ModifiedID and TSQLRecordModification.ModifiedTable.

Offline

#6 2017-11-08 15:12:00

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: Sqlite3 busy error when update main DB from OnUpdateEvent

I know, but for third party external processes accessing with JSON REST this values are not works.


Esteban

Offline

#7 2017-11-08 16:20:02

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: Sqlite3 busy error when update main DB from OnUpdateEvent

Solved busy error but still I need the fields, maybe de JSONEncode, in DoTrackChanges local procedure, can be moved as virtual function. What think you about this ?

Thanks.


Esteban

Offline

Board footer

Powered by FluxBB