Hello,
what is a replacement for DBSession.commit() in current TG2 (beta1)?
In some discussions I found, that I have to use transaction.commit(),
but it does not work for me:
UnboundExecutionError: Instance <User at 0xa8d728c> is not bound to a
Session; attribute refresh operation cannot proceed
Why I need manual commit:
1. I need to commit partial data to use a proper auto_increment
value later. After commit I can use auto incremented value to store
more records. I know, that this can be solved by changing my model and
use interaction between tables.
2. One more important thing is to show proper error message. When an
transaction fails to store (for example because there is another
unique column in database) I need to know, which error has raised and
flash proper message. I don't know, how to fix this in general.
I can remove ZopeTransactionExtension() from mi sessionmaker, but I
don't know, what it means and how it applies to other TG2 code.
DBSession.commit is working well without this extension.
Thank you.
SAL
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---