A method to avoid file deadlock during concurrent access to the sqlite database

A database and deadlock technology, applied in the database field, can solve problems such as system stability degradation, lack of multi-threaded concurrent writing, lack of large-scale relational database transactions and lock mechanisms, etc., to achieve simple results

Active Publication Date: 2019-11-08
SHENZHEN KEMAI TECH
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

As a file database, sqlite does not have the ability to write concurrently by multiple threads, and it does not have the complex transaction and lock mechanism provided by large relational databases (such as oracle, sybase, sqlserver, etc.) to solve this problem
Therefore, in the actual development process of application software, we usually face such a problem: when the client is writing data to the local sqlite database due to user operations, if it is performing two-way data exchange with the remote server at this time, the Because the sqlite database has been locked, the data exchange operation cannot run normally. This problem occurs more frequently in a multi-threaded environment.
[0015] One: It greatly increases the difficulty of software design and development, which in turn leads to an increase in the cost of software development and a decrease in system stability

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method to avoid file deadlock during concurrent access to the sqlite database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0030] It should be understood that the specific examples described here are only used to explain the present invention, not to limit the present invention.

[0031] refer to figure 1 , set forth the method for avoiding sqlite database of the present invention to produce file deadlock when concurrently accessing, and its steps are as follows:

[0032] S1: In the software design stage, classify the read and write operations of different types of requirements for the sqlite database in the software, and design corresponding multiple sqlite databases according to different types of read and write operations;

[0033] S2: In the software design stage, all the data tables used in the software system are classified according to different types of read and write operations, and placed in the corresponding multiple sqlite databases in S1;

[0034] S3: In the coding implementation phase of the software, add a logical module for unified operation on the sqlite database, through which a...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method for avoiding file deadlock during concurrent access to sqlite databases. In the software design stage, one sqlite database on the client side is split into two or more, and each sqlite database corresponds to a certain type of database in the software system. The demand for write operations. Classify all data tables in the software system according to different types of write operations, and place them in different sqlite database files. This can ensure that different types of write operations correspond to different files. When multiple threads in the application software generate write operations at the same time, they are written to different physical disk files, thereby avoiding a The problem that the sqlite database file cannot be concurrently written by multiple threads at the same time.

Description

technical field [0001] The invention belongs to the field of databases, and in particular relates to a method for avoiding file deadlock during concurrent access of SQLite databases in commercial application software. Background technique [0002] As a small relational database commonly used on various operating system platforms, sqlite is widely used in PCs, mobile phones, tablets and other mobile devices. But in actual projects, it is usually necessary to exchange data between the sqlite database and the remote server. As a file database, sqlite does not have the ability to write concurrently by multiple threads, and it does not have the complex transaction and lock mechanism provided by large relational databases (such as oracle, sybase, sqlserver, etc.) to solve this problem. Therefore, in the actual development process of application software, we usually face such a problem: when the client is writing data to the local sqlite database due to user operations, if it is p...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/52G06F16/25
CPCG06F16/25G06F9/524G06F16/2336G06F16/1774
Inventor 邹锦元陈宏亮
Owner SHENZHEN KEMAI TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products