Re: A solution for django/postgresql transaction problem

2009-02-26 Thread Karen Tracey
On Thu, Feb 26, 2009 at 9:22 AM, Sushant Sinha wrote: > I agree with you that a user code can best determine whether to roll > back or commit. However, I think this is not reflected in the > documentation for the models at all. > > http://docs.djangoproject.com/en/dev/ref/models/instances/?from=o

Re: A solution for django/postgresql transaction problem

2009-02-26 Thread Sushant Sinha
On Wed, 2009-02-25 at 23:09 -0500, Karen Tracey wrote: > You want to use the transaction commit/rollback routines, not cursor > ones: > > http://docs.djangoproject.com/en/dev/topics/db/transactions/ I did not know about this. > > > I think that the cursor should rollback if

Re: A solution for django/postgresql transaction problem

2009-02-25 Thread Karen Tracey
On Wed, Feb 25, 2009 at 10:29 PM, Sushant Sinha wrote: > > I am also facing the same problem. Here is the description of my > problem. The code tries to create a new user and emits an error when > an error happens: > > try: >user = auth.models.User.objects.create_user(uname, email, password >

Re: A solution for django/postgresql transaction problem

2009-02-25 Thread Sushant Sinha
I am also facing the same problem. Here is the description of my problem. The code tries to create a new user and emits an error when an error happens: try: user = auth.models.User.objects.create_user(uname, email, password = passwd) except db.IntegrityError: htmldict['msg'] = 'Username "

Re: A solution for django/postgresql transaction problem

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 9:58 AM, azer wrote: > > Hi, > I modified django's db/backends/postgresq_psycopg2/base.py and fixed > the problem.I added this lines before "cursor = self.connection.cursor > ()": > ># if transaction is broken, run rollback method >if self.connection.get_transactio

A solution for django/postgresql transaction problem

2009-02-10 Thread azer
Hi, I modified django's db/backends/postgresq_psycopg2/base.py and fixed the problem.I added this lines before "cursor = self.connection.cursor ()": # if transaction is broken, run rollback method if self.connection.get_transaction_status()==3: self.connection.rollback() # I hope