java.lang.ArrayIndexOutOfBoundsException: asked for back ref X but there are only 0 back refs

StackOverflow https://stackoverflow.com/questions/19960929

سؤال

I'm doing some database work on Android, and get the following error when trying to insert a bunch of records using applyBatch.

java.lang.ArrayIndexOutOfBoundsException: asked for back ref 26 but there are only 0 back refs

What's causing this?

هل كانت مفيدة؟

المحلول

For me, it turns out that I was trying to insert a group of records using applyBatch, but one of the later records depended on an earlier record in the group being inserted correctly, which it wasn't (it failed).

I identified the error by doing "applyBatch" with each of the ContentOperations, one at a time. Then i could easily see why it was failing.

Note that this post was helpful in figuring out the problem.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top