hi guys, 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