Baseflow / flutter_cached_network_image

Download, cache and show images in a flutter app
https://baseflow.com
2.44k stars 654 forks source link

database locked #299

Open yayxs opened 4 years ago

yayxs commented 4 years ago

Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a trasection

renefloor commented 4 years ago

Can you reproduce this?

Saifallak commented 4 years ago

getting alot of this warning

I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction

i think it's happening when opening a page with alots of cached images

davidmartos96 commented 4 years ago

I started to notice this as well when loading some cached images. I am not able to reproduce it constantly, but my app has like 10 cached images in the home page, and it seems to lock when some days have passed after opening my deployed app, so it may be something regarding the loading of old / invalid images from the cache.

zinwalin commented 4 years ago

getting alot of this warning

I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
I/flutter ( 9137): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction

i think it's happening when opening a page with alots of cached images

same here.

image

renefloor commented 4 years ago

Are you also use a database for other parts of your app?

zinwalin commented 4 years ago

Are you also use a database for other parts of your app?

It happens only in pages which used cached_network_image.

renefloor commented 4 years ago

Are you also use a database for other parts of your app?

It happens only in pages which used cached_network_image.

I understand, but that was not my question. I'm just trying to understand what is going wrong.

My question was if you use a database in other parts of your app. Do you use sqflite or anything similar that is also calling a database?

hooshyar commented 4 years ago

Hello, I have the same problem, I'm not using any kind of database yet, only API requests.

hooshyar commented 4 years ago

When I load for example 3-4 images, there isn't a problem, but when image count rises the error appears and screen locks, I can guess that writing more than 4-5 large files to the Database without using transactions, causes this.

ariefwijaya commented 4 years ago

I have the same problem here,

06-19 02:50:20.815 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:20.922 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:20.930 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:21.020 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:21.048 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:21.237 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:21.582 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:21.610 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:22.081 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:22.082 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:22.082 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
06-19 02:50:22.082 29857-30011/com.tcel.musicatl I/flutter: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction
imran-samed commented 4 years ago

Any solution for this ?? I'm also facing same issue.

I have 300+ images in ListView

jim-blip commented 4 years ago

I have the same problem.

Is there a workaround available?

Swepilot commented 4 years ago

Having the same issue when loading cached map tiles using flutter_map. I'm using a local sqlite database for other parts of the app. It only seems to happen when loading several map layers at the same time. A few map layers loaded at the same time does not produce this problem. Any ideas?

aBuder commented 4 years ago

I have the same problem with 100 images

mhorizon commented 3 years ago

I used database for other part of my app and have the same problem with images in list

no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Saifallak commented 3 years ago

@baseflow this should be reopened

renefloor commented 3 years ago

It would be great if anybody can give a reproducible example, because things that 'happen sometimes' are really hard to fix.

andynvt commented 2 years ago

any updates?

MrVipinVijayan commented 2 years ago

I am also facing this issue. App getting stuck.

MrVipinVijayan commented 2 years ago

Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction. app crashes

Nithinjovee commented 1 year ago

Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction

this Error crash my app i have simple code , 1000+ images listview

mustafa-707 commented 2 days ago

2024 still facing it cached_network_image: ^3.4.1

I/flutter (16503): Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction

it looks the delete query in this package not doing it in transaction correctly