Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am suddenly getting the following errors from SQLite after adding a new transaction:

The database file is locked database is locked

Has anyone seen this? I added an update transaction (following some successful selects/inserts). I can't find anything different about this one...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
489 views
Welcome To Ask or Share your Answers For Others

1 Answer

I figured it out. From looking at this [really old] thread on the phxsoftware site, it seems like there can be locking problems if you don't immediately dispose of readers and commands after executing them.

I fixed my problem by making sure to not keep commands or readers around and surrounding them with using statements.

(Web archived version of the link)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...