This repository has been archived by the owner on Jun 3, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix a crash for storageModule:
crash stack
java stack
java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.
at android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(SQLiteConnectionPool.java:962)
at android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:599)
at android.database.sqlite.SQLiteConnectionPool.acquireConnection(SQLiteConnectionPool.java:348)
at android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:894)
at android.database.sqlite.SQLiteSession.executeForLong(SQLiteSession.java:650)
at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:125)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:886)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:874)
at android.database.sqlite.SQLiteDatabase.getPageSize(SQLiteDatabase.java:941)
at android.database.sqlite.SQLiteDatabase.setMaximumSize(SQLiteDatabase.java:924)
at com.taobao.weex.appfram.storage.WXSQLiteOpenHelper.ensureDatabase(WXSQLiteOpenHelper.java:179)
at com.taobao.weex.appfram.storage.WXSQLiteOpenHelper.getDatabase(WXSQLiteOpenHelper.java:78)
at com.taobao.weex.appfram.storage.DefaultWXStorage.performGetItem(DefaultWXStorage.java:239)
at com.taobao.weex.appfram.storage.DefaultWXStorage.access$100(DefaultWXStorage.java:39)
at com.taobao.weex.appfram.storage.DefaultWXStorage$2.run(DefaultWXStorage.java:79)
at com.taobao.weex.common.WXThread$SafeRunnable.run(WXThread.java:48)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
This exception is caused by asynchronous read and write db, so add try catch to db operation and move close operation to same thread