mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
fix(MainDb): fix sql lock
This commit is contained in:
parent
e0b2b41290
commit
ac482f58b7
2 changed files with 4 additions and 6 deletions
|
|
@ -450,7 +450,7 @@ void ChatMessagePrivate::notifyReceiving () {
|
|||
LinphoneChatRoom *chatRoom = L_GET_C_BACK_PTR(q->getChatRoom());
|
||||
if ((getContentType() != ContentType::Imdn) && (getContentType() != ContentType::ImIsComposing)) {
|
||||
linphone_chat_room_notify_chat_message_should_be_stored(chatRoom, L_GET_C_BACK_PTR(q->getSharedFromThis()));
|
||||
|
||||
|
||||
if (toBeStored)
|
||||
storeInDb();
|
||||
}
|
||||
|
|
@ -784,6 +784,9 @@ void ChatMessagePrivate::updateInDb () {
|
|||
|
||||
unique_ptr<MainDb> &mainDb = q->getChatRoom()->getCore()->getPrivate()->mainDb;
|
||||
shared_ptr<EventLog> eventLog = mainDb->getEventFromKey(dbKey);
|
||||
|
||||
// Avoid transaction in transaction if contents are not loaded.
|
||||
loadContentsFromDatabase();
|
||||
mainDb->updateEvent(eventLog);
|
||||
|
||||
if (direction == ChatMessage::Direction::Incoming) {
|
||||
|
|
|
|||
|
|
@ -1410,11 +1410,6 @@ void MainDb::init () {
|
|||
return sanitized;
|
||||
};
|
||||
|
||||
// Disable locking. (Issue on Android on crash.)
|
||||
// See: https://stackoverflow.com/questions/17348480/how-do-i-prevent-sqlite-database-locks
|
||||
if (backend == Sqlite3)
|
||||
*session << "PRAGMA read_uncommitted = ON";
|
||||
|
||||
// TODO: Migrate all statements in statements.cpp.
|
||||
*session <<
|
||||
"CREATE TABLE IF NOT EXISTS sip_address ("
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue