Ján ONDREJ (SAL) wrote:
> Hi,
>
>   
>> Because it is needed by repoze.tm middleware that manages the
>> transactions for you.
>>
>> The bottomline is that you *shouldn't*  need (or even further aren't
>> allowed) to begin and commit/rollback transactions manually.
>>
>> This works for me without a hitch. Maybe you need to adjust the setup of
>> the DBSession to match whatever the current TG2 is doing (under the
>> assumption that your app has been developed over the course of a few
>> TG2-subreleases/trunk-versions)
>>     
>
> Hmm, ok. May be me english is not good enough.
>
> Can somebody give me an example, how to handle database errors (like
> unique key exceptions or foreign key problems) in current TG2? I have
> one project in TG1, which has been updated to run under TG2. I like
> news in TG2, but I really need to handle SQL problems some nice way
> and don't raise standard error without any description, which is
> default in TG.
>   
You could perhaps try to commit the transaction manually in your 
controller and handling yourself any exception that occurs:

try:
    transaction.commit()
except StandardError, e:
    handle_exception(e)

Alberto

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

Reply via email to