Friends,

    I have this code:

t = db.transaction()
                try:
                    insert_id = db.insert(self.__table__,
titulo=form.titulo, slug=slug, tipo=form.tipo, midia=form.midia,
url_galeria=form.url_galeria,
data_criacao=datetime.strptime(form.data_criacao,'%Y-%m-%d %H:%M:%S'),
autor=usuario.id)
                    db.update(self.__table__, where="id=$insert_id",
status='W', vars=locals())
                    moderate_id = db.insert('website_moderacao',
data_hora=datetime.now(), autor=usuario.id,
onde=generate_url(self.get_class_name(), insert_id),
operacao='Inserir')
                    db.update(self.__table__, where="id=$insert_id",
moderate_id='%s' % moderate_id, vars=locals())
                except:
                    t.rollback()
                    raise
                else:
                    t.commit()

   And I see two details:
        a) the insert and the updates are executed before the
t.commit() because the sequence value is updated before of the
commit() method.
        b) the rollback() method don't return the value of the
sequences to the original value (before the insert).

are there a special configuration in the postgreSQL ? or this it's a
problem in the webpy ?
My production version of web.py is 0.34

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to