#1 2025-02-16 00:20:48

zen010101
Member
Registered: 2024-06-15
Posts: 106

ORM operation failed

After the execution of aDB.Backup(), all my ORM operations failed. Here is the error message:

ESqlite3Exception {Message:"Error SQLITE_MISUSE (21) [SELECT ID,Channelname,Url,Suburl,Tcpmode,Onvif,User,Password,Sipid,Sipstreams,Sipchannelname FROM Inputstream WHERE RowID=?] using 3.46.1 - bad parameter or other API misuse",ErrorCode:21,SQLite3ErrorCode:"secMISUSE"} [] at 53d310 ../../src/db/mormot.db.raw.sqlite3.pas  (5828) ../../src/db/mormot.db.raw.sqlite3.pas  (8642) ../../src/db/mormot.db.raw.sqlite3.pas  (8964) ....

Did I do something wrong?

Offline

#2 2025-02-16 17:58:58

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

Re: ORM operation failed

As documented, TSqlDataBase.Backup() closes the database so it is not suited for multi-threaded ORM for sure.

Try to use TSqlDataBase.BackupBackground() instead.
This is actually tested in https://github.com/synopse/mORMot2/blob … .pas#L1761
(the regression tests are a good place to look at and search for patterns)

Offline

Board footer

Powered by FluxBB