Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8389257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:40:40+00:00 2026-06-09T18:40:40+00:00

I am trying to use AsyncQueryHandler to insert items in my Database in a

  • 0

I am trying to use AsyncQueryHandler to insert items in my Database in a separate thread but when I go and try to insert something I get a SQLException

exception

08-16 18:57:13.662: E/SQLiteLog(17319): (1) table Part1s has no column named name
08-16 18:57:13.672: E/SQLiteDatabase(17319): Error inserting frame_number=2 name=Jeff game_id=1
08-16 18:57:13.672: E/SQLiteDatabase(17319): android.database.sqlite.SQLiteException: table Part1s has no column named name (code 1): , while compiling: INSERT INTO Part1s(frame_number,name,game_id) VALUES (?,?,?)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:882)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:493)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1467)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1339)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at com.tyczj.bowling.providers.Games.insert(Games.java:382)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.content.ContentProvider$Transport.insert(ContentProvider.java:201)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.content.ContentResolver.insert(ContentResolver.java:864)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.content.AsyncQueryHandler$WorkerHandler.handleMessage(AsyncQueryHandler.java:96)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.os.Looper.loop(Looper.java:137)
08-16 18:57:13.672: E/SQLiteDatabase(17319):    at android.os.HandlerThread.run(HandlerThread.java:60)
08-16 18:57:13.672: E/AndroidRuntime(17319): FATAL EXCEPTION: AsyncQueryWorker
08-16 18:57:13.672: E/AndroidRuntime(17319): android.database.SQLException: Failed to insert row into content://com.tyczj.bowling.providers.Games/Part1s
08-16 18:57:13.672: E/AndroidRuntime(17319):    at com.tyczj.bowling.providers.Games.insert(Games.java:387)
08-16 18:57:13.672: E/AndroidRuntime(17319):    at android.content.ContentProvider$Transport.insert(ContentProvider.java:201)
08-16 18:57:13.672: E/AndroidRuntime(17319):    at android.content.ContentResolver.insert(ContentResolver.java:864)
08-16 18:57:13.672: E/AndroidRuntime(17319):    at android.content.AsyncQueryHandler$WorkerHandler.handleMessage(AsyncQueryHandler.java:96)
08-16 18:57:13.672: E/AndroidRuntime(17319):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-16 18:57:13.672: E/AndroidRuntime(17319):    at android.os.Looper.loop(Looper.java:137)
08-16 18:57:13.672: E/AndroidRuntime(17319):    at android.os.HandlerThread.run(HandlerThread.java:60)

here is where I do my inserting

        for(int i = 0;i<10;i++){
        int num = i+1;
        values.put(Games.NAMES_FRAME_NUM,num);
        values.put(Games.NAMES_GAME_ID,gameid);
        values.put(Games.NAMES_NAME,name);
        qHandler.startInsert(0, null, Games.NAMES_URI,values);
//          getContentResolver().insert(Games.NAMES_URI, values);
        names(i,name);
        values.clear();
        values.put(Games.PART1_FRAME_NUM,num);
        values.put(Games.PART1_NUM,"0");
        values.put(Games.PART1_GAME_ID,gameid);
        qHandler.startInsert(0, null, Games.PART1_URI,values);
//          getContentResolver().insert(Games.PART1_URI, values);
        values.clear();
        values.put(Games.PART2_FRAME_NUM,num);
        values.put(Games.PART2_NUM,"0");
        values.put(Games.PART2_GAME_ID,gameid);
        qHandler.startInsert(0, null, Games.PART2_URI,values);
//          getContentResolver().insert(Games.PART2_URI, values);
        values.clear();
        values.put(Games.TOTALS_FRAME_NUM,num);
        values.put(Games.TOTALS_FRAME_TOTAL,"0");
        values.put(Games.TOTALS_GAME_ID,gameid);
        qHandler.startInsert(0, null, Games.TOTALS_URI,values);
//          getContentResolver().insert(Games.TOTALS_URI, values);
        values.clear();
//          ContentValues values = new ContentValues();
        values.put(Games.POCKETS_BOWLER_ID,bowlerClickedID);
        values.put(Games.POCKETS_FRAME_NUM,i);
        values.put(Games.POCKETS_GAME_ID,gameID);
        values.put(Games.POCKETS_TEAM_ID, teamSelectedID);
        values.put(Games.POCKETS_TOURNAMENT_ID, tournamentID);
        values.put(Games.POCKETS_NUM, 0);
        values.put(Games.POCKETS_SEASON, pref.getLong(Preferences.SELECTED_SEASON, 1));
        qHandler.startInsert(0, null, Games.POCKETS_URI,values);
//          getContentResolver().insert(Games.POCKETS_URI, values);
        values.clear();
    } 

Now I know the error says no such column but as you can see in my for loop I clear the values after each insert and if I just use the normal getContentResolver().insert() I have no problems and never get this error so it seems the values are getting mixed up somehow?

and before anyone says says just use an AsyncTask I already did that and when executing the for loop the inserts still hold up the UI. see this question for what I am experiencing

So anyway what would be causing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:40:42+00:00Added an answer on June 9, 2026 at 6:40 pm

    I think you might be doing a concurrent access on the same ContentValues object while Async update is going on.

    You have to wait until onInsertComplete callback is recieved or easier way is to just get a new object of ContentValues each time

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying use Thread but i have some problem (I am beginner at
trying to use hibernate with my web app and getting following exception: Initial SessionFactory
trying to use the preferred on method call but the code is not working
I am trying use filehelpers class builder but I am kinda confused on what
I was trying use svn to find a checkin using svn log, but it
I am trying use std::copy to copy from two different iterator. But during course
I'm trying use the Sum method in a lambda expression for a comparison, but
I'm trying use double type in openCL, but doesn't work anyway, i want use
Trying to use Java's regexp I want to match /app, /app/.* , but not
Trying to use a guid as a resource id in a rest url but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.