Code

Changes between Initial Version and Version 2 of Ticket #15383


Ignore:
Timestamp:
02/22/11 17:44:23 (3 years ago)
Author:
russellm
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15383

    • Property Status changed from new to closed
    • Property Patch needs improvement unset
    • Property Needs tests unset
    • Property Needs documentation unset
    • Property Resolution changed from to invalid
  • Ticket #15383 – Description

    initial v2  
    55 
    66Example 
    7  
     7{{{ 
    88@transaction.commit_manually 
    99def example(request): 
    1010    transaction.rollback() 
    1111    another_func() 
    12  
     12}}} 
    1313If the proc returns an HttpResponse or a redirect or whatever after the rollback this works fine. Trying to debug the django code I've realized that the transaction rollbacks fine and the connection is set to _dirty=False. But as soon as another function is called the connection is flagged to dirty again. Now even if the function called does not have the decorator the connection will be set to dirty. 
    1414 
    1515Not sure at all if the expected behavior is to set the connection to dirty but it looks to me like it's causing this issue since the following code checks that variable and just throws an error: 
    16  
     16{{{ 
    1717 def leave_transaction_management(self): 
    1818        """ 
     
    3232                "pending COMMIT/ROLLBACK") 
    3333        self._dirty = False 
    34  
     34}}} 
    3535This is on the trunk version 1.3 beta 1 SVN-15632 
    3636 
    3737This is my stack trace: 
    38  
     38{{{ 
    3939Unexpected error in request /register/ : Traceback (most recent call last): 
    4040  File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py", line 111, in get_response 
     
    5151    raise TransactionManagementError("Transaction managed block ended with " 
    5252TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK 
     53}}}