On 11/15/2011 03:21 PM, alex bodnaru wrote:
> On 11/15/2011 01:18 AM, Diez B. Roggisch wrote:
>>
>> Am 14.11.2011 um 16:20 schrieb alex bodnaru:
>>
>>> On 11/14/2011 09:40 AM, Diez B. Roggisch wrote:
>>>>
>>>> Am 13.11.2011 um 19:48 schrieb alex bodnaru:
>>>>
>>>>>
>>>>> hello diez, other friends,
>>>>>
>>>>> thanks a lot for your consideration.
>>>>>
>>>>> On 11/13/2011 08:11 PM, Diez B. Roggisch wrote:
>>>>>>
>>>>>> Is it possible that you have declared models in different sessions? This 
>>>>>> has cause me similar issues
>>>>>> before. It means essentially that you have two connections open, for 
>>>>>> each session. And commits over the middleware only affect one of them.
>>>>>>
>>>>> i have, deep in my heart, a similar suspicion, but no idea of a way to 
>>>>> check it.
>>>>> indeed, the same db user is making other connections as well from another 
>>>>> site
>>>>> program.
>>>>> but these kept occurring when i run ddl and dml successfully through sa, 
>>>>> even
>>>>> with the same model, but not through tg controllers.
>>>>>
>>>>> moreover, my failing code is successfully doing a select before it 
>>>>> attempts to
>>>>> update and fails. before trying to update, i tried some ddl without 
>>>>> select, but
>>>>> with the same failure.
>>>>>
>>>>> any idea of a way i could check your suspicion?
>>>>
>>>>
>>>> Not really - deep debugging it is. Try reducing to a minimal working (or 
>>>> not working...) example. Debug the commit()-call from TW. Try & see where 
>>>> object state is kept, by session.
>>> do you mean i should check whether the session being committed in
>>> transaction.commit() is DBSession?
> i've pretty printed the DBSession and transaction objects, an found the
> DBSession within the transaction.
>>
>> Or that the objects that don't get committed aren't part of DBSessien. 
>> Something like that. It's impossible to tell anything from here, without 
>> having a non-working example.
> maybe the answer is in this sentence. i have to mention, i have used
> dbsession.execute("update ..."), since i'm using a big existing database. what
> objects did i have to add to the session in this case?
indeed, the answer was here, to inform the transaction manager that the session
has something to commit. the working solution by jonathan shemoul:
from zope.sqlalchemy.datamanager import mark_changed
        mark_changed(DBSession())

thanks a lot,
alex
> meanwhile, inserts worked on the few mapped tables, like in bootstrap and in 
> the
> controller too.
>>
>>> did you suggest there's debugging functionality in toscawidgets (TW). any
>>> document for that?
>>
>> Nope, there is just the PDB. Familiarze yourself with it, if you haven't.
>>
>>   import pdb; pdb.set_trace()
>>
>> is your friend.
>>
>> Diez
>>
> 

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