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

  • SEARCH
  • Home
  • 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 3211274
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:42:58+00:00 2026-05-17T14:42:58+00:00

I encountered an error when doing the following retrieval: class status(models.Model): pid = models.IntegerField()

  • 0

I encountered an error when doing the following retrieval:

class status(models.Model):
    pid = models.IntegerField()
    phase = models.TextField()
    rejected = models.IntegerField()
    accepted = models.IntegerField()
    type = models.IntegerField(default=1)
    date = models.DateTimeField(primary_key = True)
    time_taken = models.IntegerField(null = True)

    class Meta:
        db_table = "crawl_status_ss"

query:

    statusIn = status.objects.get(pid=12345,phase='crawling')

Error:

django.db.utils.DatabaseError: current transaction is aborted, commands ignored
until end of transaction block

Does anyone knows whats the reason?

EDIT:

In my previous section of my code, I have an exception when inserting an entry to another table, but i caught the exception:

for entry in blogEntries:        
            link = entry['link'].encode('utf-8')
            title = entry['title'].encode('utf-8')
            date1 = entry['date'][:10].encode('utf-8')
            content = entry['content'].encode('utf-8')
            try:
                post = postTitle(site_id=url,post_url=link,post_title=title)
                post.save()
                postId = post.post_id

                hashString = getMD5Hash(content)

                blogContent = postContent(post_content=content,post_id=post,hash=hashString,site_id = url,post_date=date1)
                blogContent.save()

            except:
                print 'Error:' + str(sys.exc_value)
                continue
  • 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-05-17T14:42:59+00:00Added an answer on May 17, 2026 at 2:42 pm

    Django stats a database transaction for your view. So when you catch the exception, it means the transaction is in a failed state and you can’t run any more SQls. You should really try to figure what the actual problem is when it fails either in your post.save or blogContent.save methods. If you really don’t care (since you just catch the exception and continue), you should manage transactions yourself. See the docs for help on this:

    • Managing database transactions
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've encountered the following bug: http://issues.apache.org/jira/browse/AXIS2-4363 It states the following: This error only occurs
I encountered a stored procedure that had the following error handling block immediately after
I encountered this error: Cannot implicitly convert type System.Web.UI.WebControls.LoginView to Login The error occured
I encountered this error: The type or namespace name 'WebControls' could not be found
I encountered an error. Despite declaring the variables (failturetext and userName) errors still appear.
I've encountered an error with the arguments I've passed to my function. So far
I have often encountered an error such as cannot convert from 'method group' to
I have encountered this error when trying to delete a cell, using a custom
Using NHibernate 1.x we encountered this error, suddently, during a nigthly job: 25/06/2012 22:50:59
Hi I have just started learning WCF and I have encountered an error I

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.