Joshua D. Drake skrev:
> Nis Jørgensen wrote:
>> [...] anytime a
>> database error occurs, all subsequent calls to the database fails with
>> the error message "ProgrammingError: current transaction is aborted,
>> commands ignored until end of transaction block".
>>     
>
> That is how PostgreSQL works. Your only option at that point is to 
> rollback and start again. Unless you change your isolation level.
>   
I (kind of) know that. But I would expect Django to take care of rolling
back the transaction in case of failure.

>> This causes unittesting to break, since the tearDown will try to use the
>> existing database connection, as well as giving me strange error
>> messages at other times. You vcan see an example of the latter at the
>> bottom of my mail.
>>
>> I have found that I can eliminate the problem by substituting this line
>>             self.connection.set_isolation_level(1) # make transactions
>> transparent to all cursors
>>     
>
> This will work fine.
>   
From a quick glance at the source+documentation, it seems like this
(replacing with 0 in the line above) would basically revert everything
to autocommit - and thus remove the ability to use for instance
commit_on_success.

But since I don't have any need for transaction management at the
moment, I will leave it as is.

/Nis




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to