Sorry my email wasn't clear. With DBSession.commit() I am getting the  
error "Transaction must be committed by zope" which is coherent with  
what you say. But when I remove the commit TG2 crashes without any  
error message. When I remove DBSession.save(user) nothing gets saved  
in the database.



On Sep 22, 2008, at 5:51 PM, Mark Ramm wrote:

>
> You no longer need to call DBSession.commit() explicitly in a4, the
> framework does this for you automatically at the end of the request.
>
> This allows things like authorization to have the same transaction
> boundary as your code.   It also allows for sub-apps like Rum to reuse
> the existing transaction boundary, rather than create their own.
>
> Without the traceback it's hard to be sure that I'm pointing out the
> right problem, but I'd recommend just removing the DBSession.commit()
> line and seeing what happens.
>
> --Mark
>
> On Mon, Sep 22, 2008 at 8:03 PM, Fred C <[EMAIL PROTECTED]> wrote:
>>
>>
>> TG2 crashed with this code... I am running TurboGears2-1.9.7a4. Any
>> idea, Am I doing something wrong ?
>>
>>    @expose()
>>    @validate(user_form, error_handler=index)
>>    def create(self, **kw):
>>        user = User(user.user_name=kw['user_name'],
>>               display_name=kw['display_name'],
>>               email_address=kw['email_address'],
>>               password=kw['password'])
>>        DBSession.save(user)
>>        DBSession.commit()
>>        raise redirect('/')
>>
>> Thanks
>> -fred-
>>
>>>
>>
>
>
>
> -- 
> Mark Ramm-Christensen
> email: mark at compoundthinking dot com
> blog: www.compoundthinking.com/blog
>
> >


--~--~---------~--~----~------------~-------~--~----~
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