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 7834943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:24:37+00:00 2026-06-02T13:24:37+00:00

My code is: Statement mstatement = null; URI uri = URI.create(DBPath); sqliteDb = DatabaseFactory.openOrCreate(uri);

  • 0

My code is:

Statement mstatement = null;
URI uri = URI.create(DBPath);
sqliteDb = DatabaseFactory.openOrCreate(uri);

mStatement = sqliteDb.createStatement(strQuery);
mStatement.prepare();

My problem is, I am getting error as “Sqlite pendingOperation” at mstatement.prepare();.
I am using synchronized blocks at each and every database handling methods. This is happening while multiple threads are running.

  • 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-02T13:24:39+00:00Added an answer on June 2, 2026 at 1:24 pm

    I got my answer by myself.

    I modified all method as(in bold):

    Cursor c = null;
    DBHelper.mStatement = null;
    Vector followups = new Vector();
    **boolean runFlag = true;**
    synchronized (GlobalVariables.lockObject) {
    try {
    **while(runFlag)**
    SELECT EventId,OldTitle,OrderNumber,Status,Title,Type,UpdateDateTime,Id FROM Questions WHERE EventId=5 AND Type=1 AND (Status=0 OR Status=1 OR Status=2) ORDER BY OrderNumber 
    
                    DBHelper.CreateAndOpenSqliteDBConnection();
    DBHelper.mStatement = DBHelper.sqliteDb.createStatement(strQuery);
    DBHelper.mStatement.prepare();
    
    **if(DBHelper.mStatement == null)
        {
            DBHelper.CloseSqliteDBConnection();
                            runFlag = true;
                            continue;
                        }
                        else
                        {
                            runFlag = false;
                        }**
    
    c = DBHelper.mStatement.getCursor();
    
    while (c.next()) {
                        followups.addElement(Followup.getFromCursor(c));
                    }
    }
    **}**
    catch (Exception ex) {
    System.out.print(ERRORSTRING + "getUploadFollowupsFromDB: "
                            + ex);
    } finally {
    
    DBHelper.CloseSqliteDBConnection();
    }
    GlobalVariables.lockObject.notifyAll();
    }
    return followups;
    

    Great Ankit Rox..

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

Sidebar

Related Questions

Consider the following code ResultSet rs = null; Statement st = null; try {
What code I should add to accept null from WHERE statement. { int numApprovals
Problem statement: It is necessary for me to write a code, whether which before
my code is : Statement testSt = null; ResultSet rset = null; String query
If statement works fine. It's code is shown below if (getInput1.getText() != null) {
im trying to echo mediaplayer embed code with IF statement. is there any way
In this statement, taken from the Pagerank source code: Pattern.compile(\\[.+?\\]); What does the pattern
When I code and run the statement: print \x00\x00\x00 in Python it outputs three
See the log statement comments at the end of the code snippet... acceleration.x is
I'm using the following statement in my Java code and I was surprised to

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.