Hello!

  I am trying to do some INSERT to my DB from one controller method. I
do following try/except inside a loop:

try:
  DBSession.add(importe)
  DBSession.flush()
  nimportados = nimportados + 1
except Exception as ex:
  nerroneos = nerroneos + 1

I need to check how many inserts are ok and how many with error. Using
previous code I get following message when an exception occurs:

InvalidRequestError: The transaction is inactive due to a rollback in
a subtransaction. Issue rollback() to cancel the transaction.

Is there any way to force insert for each add() call and to control
errors?
Regards

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to