Re: [Django] #11900: commit_on_success: Handle Exception in commit()

2010-10-26 Thread Django
#11900: commit_on_success: Handle Exception in commit()
---+
  Reporter:  guettli   | Owner:  
gabrielhurley
Status:  closed| Milestone:  1.2
  
 Component:  Database layer (models, ORM)  |   Version:  1.0
  
Resolution:  fixed |  Keywords: 
  
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Changes (by guettli):

 * cc: h...@tbz-pariv.de (removed)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11900: commit_on_success: Handle Exception in commit()

2010-03-12 Thread Django
#11900: commit_on_success: Handle Exception in commit()
---+
  Reporter:  guettli   | Owner:  
gabrielhurley
Status:  assigned  | Milestone:  1.2
  
 Component:  Database layer (models, ORM)  |   Version:  1.0
  
Resolution:|  Keywords: 
  
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Comment (by guettli):

 Your patch is simple, contains a test and works for me. Thank you. Who can
 review and commit it?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11900: commit_on_success: Handle Exception in commit()

2010-03-11 Thread Django
#11900: commit_on_success: Handle Exception in commit()
---+
  Reporter:  guettli   | Owner:  
gabrielhurley
Status:  assigned  | Milestone:  1.2
  
 Component:  Database layer (models, ORM)  |   Version:  1.0
  
Resolution:|  Keywords: 
  
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  0 |   Needs_tests:  0  
  
Needs_better_patch:  0 |  
---+
Changes (by gabrielhurley):

  * needs_tests:  1 => 0

Comment:

 This specific bug seems to be backend-specific (it seems to be completely
 impossible to trigger it using SQLite3). I did manage to duplicate it,
 test it, and patch it using a server running psycopg2. The general
 principle of the fix seems universally applicable, though.

 The patch I added has both the requested test and an updated version of
 the original patch that works with the new MultiDB in 1.2. Hopefully it's
 good to go now.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11900: commit_on_success: Handle Exception in commit()

2010-03-11 Thread Django
#11900: commit_on_success: Handle Exception in commit()
---+
  Reporter:  guettli   | Owner:  
gabrielhurley
Status:  assigned  | Milestone:  1.2
  
 Component:  Database layer (models, ORM)  |   Version:  1.0
  
Resolution:|  Keywords: 
  
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  0 |   Needs_tests:  1  
  
Needs_better_patch:  0 |  
---+
Comment (by guettli):

 Hi Gabriel,

 thank you for your question. This script results in
 {{{
 Traceback (most recent call last):
   File "djangotest_tbz/script.py", line 10, in 
 main()
   File "/home/djangotest_tbz_d/django/db/transaction.py", line 310, in
 _commit_on_success
 leave_transaction_management(using=db)
   File "/home/djangotest_tbz_d/django/db/transaction.py", line 87, in
 leave_transaction_management
 raise TransactionManagementError("Transaction managed block ended with
 pending COMMIT/ROLLBACK")
 django.db.transaction.TransactionManagementError: Transaction managed
 block ended with pending COMMIT/ROLLBACK
 }}}

 I just tried it with latest trunk ([12761]). Postgres (psycopg2) evaluates
 Foreign-Key
 Constraints lazy (deferrable). If you break this constraint, you get an
 exception
 during commit. But you don't see the real problem.

 {{{
 from django.db import transaction, connection

 @transaction.commit_on_success
 def main():
 cursor=connection.cursor()
 cursor.execute('INSERT INTO auth_user_groups VALUES (DEFAULT,
 1000, 100);')
 transaction.set_dirty()

 if __name__=='__main__':
 main()
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11900: commit_on_success: Handle Exception in commit()

2010-03-11 Thread Django
#11900: commit_on_success: Handle Exception in commit()
---+
  Reporter:  guettli   | Owner:  
gabrielhurley
Status:  assigned  | Milestone:  1.2
  
 Component:  Database layer (models, ORM)  |   Version:  1.0
  
Resolution:|  Keywords: 
  
 Stage:  Accepted  | Has_patch:  1  
  
Needs_docs:  0 |   Needs_tests:  1  
  
Needs_better_patch:  0 |  
---+
Changes (by gabrielhurley):

 * cc: gabrielhurley (added)
  * owner:  nobody => gabrielhurley
  * status:  new => assigned

Comment:

 The reason for the problem is clear enough: The error raised in the
 finally clause overrides the original error.

 However, I tried for about 2 hours to reproduce the reported bug with no
 success.

 guettli, can you some information about the code you're using that
 triggers the bug?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11900: commit_on_success: Handle Exception in commit()

2010-02-03 Thread Django
#11900: commit_on_success: Handle Exception in commit()
---+
  Reporter:  guettli   | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  1 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * has_patch:  0 => 1
  * stage:  Unreviewed => Accepted
  * needs_tests:  0 => 1
  * milestone:  => 1.2

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11900: commit_on_success: Handle Exception in commit()

2009-09-17 Thread Django
#11900: commit_on_success: Handle Exception in commit()
---+
  Reporter:  guettli   | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  1.0   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by guettli):

  * needs_better_patch:  => 0
  * version:  1.1 => 1.0
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



[Django] #11900: commit_on_success: Handle Exception in commit()

2009-09-17 Thread Django
#11900: commit_on_success: Handle Exception in commit()
--+-
 Reporter:  guettli   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  1.1   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 If you get an exception during the commit done by the commit_on_success
 decorator, you get a meaningless error message:

 {{{
 django.db.transaction.TransactionManagementError: Transaction managed
 block ended with pending COMMIT/ROLLBACK
 }}}

 With this patch you see the real exception.

 Can someone please write a unittest for this?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---