somkiattha / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

ODK Crashes when itemsets.csv is empty #1089

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Provide an xform together with an empty itemset.csv
2. Choose Fill Blank form

What is the expected output? What do you see instead?

Should start the survey. Instead ODK crashes:

E/AndroidRuntime(13567): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime(13567): java.lang.RuntimeException: An error occured while 
executing doInBackground()
E/AndroidRuntime(13567):        at 
android.os.AsyncTask$3.done(AsyncTask.java:299)
E/AndroidRuntime(13567):        at 
java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime(13567):        at 
java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime(13567):        at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime(13567):        at 
java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime(13567):        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
E/AndroidRuntime(13567):        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
E/AndroidRuntime(13567):        at java.lang.Thread.run(Thread.java:856)
E/AndroidRuntime(13567): Caused by: java.lang.IllegalStateException: Cannot 
perform this operation because there is no current transaction.
E/AndroidRuntime(13567):        at 
android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:93
7)
E/AndroidRuntime(13567):        at 
android.database.sqlite.SQLiteSession.setTransactionSuccessful(SQLiteSession.jav
a:371)
E/AndroidRuntime(13567):        at 
android.database.sqlite.SQLiteSession.executeSpecial(SQLiteSession.java:879)
E/AndroidRuntime(13567):        at 
android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.ja
va:748)
E/AndroidRuntime(13567):        at 
android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java
:64)
E/AndroidRuntime(13567):        at 
android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1693)
E/AndroidRuntime(13567):        at 
android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1622)
E/AndroidRuntime(13567):        at 
org.odk.collect.android.database.ItemsetDbAdapter.commit(ItemsetDbAdapter.java:1
57)
E/AndroidRuntime(13567):        at 
org.odk.collect.android.tasks.FormLoaderTask.readCSV(FormLoaderTask.java:626)
E/AndroidRuntime(13567):        at 
org.odk.collect.android.tasks.FormLoaderTask.doInBackground(FormLoaderTask.java:
304)
E/AndroidRuntime(13567):        at 
org.odk.collect.android.tasks.FormLoaderTask.doInBackground(FormLoaderTask.java:
1)
E/AndroidRuntime(13567):        at 
android.os.AsyncTask$2.call(AsyncTask.java:287)
E/AndroidRuntime(13567):        at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime(13567):        ... 4 more
W/ActivityManager(  474):   Force finishing activity 
org.odk.collect.android/.activities.FormEntryActivity

What version of the product are you using? On what operating system?
ODK Collect 1.4.4 (1045)

Please provide any additional information below.
We always include a itemsets.csv file in the manifest because we generate 
xforms on demand and so don't know ahead of time if a survey will require 
itemsets. For those that do not, we were serving an empty itemsets.csv. We have 
worked around the problem by adding a "dummy" itemset with one item that is 
never referenced, but it took awhile to figure out :-)

Original issue reported on code.google.com by alex@bedatadriven.com on 22 Nov 2014 at 10:10