Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when row size exceeds several hundreds of kilobytes #341

Closed
kemsky opened this issue Jun 21, 2017 · 3 comments
Closed

Exception when row size exceeds several hundreds of kilobytes #341

kemsky opened this issue Jun 21, 2017 · 3 comments

Comments

@kemsky
Copy link

kemsky commented Jun 21, 2017

Expected Behavior

No Exception or reasonable exception.

Actual Behavior

Non-fatal Exception: java.lang.Exception: get field slot from row 0 col 0 failed
       at com.dmsapplication.command.report.ReceiptEmailSender.sendReceiptReport(ReceiptEmailSender.java:55)
       at com.dmsapplication.services.ServiceSendReceipt.send(ServiceSendReceipt.java:90)
       at com.dmsapplication.services.ServiceSendReceipt.onIntent(ServiceSendReceipt.java:59)
       at com.dmsapplication.services.AbstractIntentService.onHandleIntent(AbstractIntentService.java:34)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by java.lang.IllegalStateException: get field slot from row 0 col 0 failed
       at net.sqlcipher.CursorWindow.getLong_native(CursorWindow.java)
       at net.sqlcipher.CursorWindow.getLong(CursorWindow.java:450)
       at net.sqlcipher.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:110)
       at net.sqlcipher.AbstractCursor.moveToPosition(AbstractCursor.java:201)
       at net.sqlcipher.AbstractCursor.moveToNext(AbstractCursor.java:230)
       at android.database.CursorWrapper.moveToNext(CursorWrapper.java:166)
       at nl.qbusict.cupboard.QueryResultIterable$QueryResultIterator.<init>(QueryResultIterable.java:118)
       at nl.qbusict.cupboard.QueryResultIterable.iterator(QueryResultIterable.java:46)
       at nl.qbusict.cupboard.QueryResultIterable.get(QueryResultIterable.java:65)
       at nl.qbusict.cupboard.QueryResultIterable.get(QueryResultIterable.java:60)
       at nl.qbusict.cupboard.DatabaseCompartment$QueryBuilder.get(DatabaseCompartment.java:598)
       at com.dmsapplication.command.ReceiptFacade.getReceiptReport(ReceiptFacade.java:251)
       at com.dmsapplication.command.report.ReceiptEmailSender.sendReceiptReport(ReceiptEmailSender.java:41)
       at com.dmsapplication.services.ServiceSendReceipt.send(ServiceSendReceipt.java:90)
       at com.dmsapplication.services.ServiceSendReceipt.onIntent(ServiceSendReceipt.java:59)
       at com.dmsapplication.services.AbstractIntentService.onHandleIntent(AbstractIntentService.java:34)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.os.HandlerThread.run(HandlerThread.java:61)

Steps to Reproduce

Row record contains several columns, couple of them can be rather large 100kb+.
Probably i'm hitting this issue https://stackoverflow.com/questions/5406429/cursor-size-limit-in-android-sqlitedatabase, however it is not obvious.

SQLCipher version (can be identified by executing PRAGMA cipher_version;):
3.4.0

SQLCipher for Android version:
3.5.3

Note: If you are not posting a specific issue for the SQLCipher library, please consider posting your question to the SQLCipher discuss site. Thanks!

@developernotes
Copy link
Member

Hello @kemsky

We made some changes recently that address reading larger amounts of data into the underlying CursorWindow when retrieving results. Would you try upgrading to SQLCipher for Android 3.5.7 (the current latest) to see if the newer build addresses your issue? Thanks!

@kemsky
Copy link
Author

kemsky commented Jun 22, 2017

Version 3.5.7 works, thanks. Could you tell me current size limits if they still exist?

@developernotes
Copy link
Member

Hello @kemsky

We are glad to hear 3.5.7 is working well for you. We've adjusted the library to allow it to dynamically resize the backing memory for the cursor, so you would be limited by the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants