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