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 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

Has anyone encountered this error using SQL Server 2005 and Data access application blocks
I encountered the above error message after applying the OutputCache attribute on ActionResult methods
I have encountered a rather odd error that I do not understand. I created
I encounter an error of the form: The model item passed into the dictionary
I encountered the following ddl in a pl/sql script this morning: create index genuser.idx$$_0bdd0011
I've encountered some errors when I tried to install an artifact manually with Maven
I frequently encounter this situation in my VB6 applications Private Sub DoSomething On Error
We encountered a problem with using Subversion on Windows. A developer committed a file
I encountered a problem when running some old code that was handed down to
I encountered this term Hindley-Milner , and I'm not sure if grasp what it

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.