all the old behavior is available either through using the  
sessioncontext extension, where you have very accurate control over  
how youd like to configure the behavior, or using the threadlocal  
extension to do the old behavior fully.  not sure how that all  
integrates with TurboGears, though.   check out the "plugins" docs.

On Oct 24, 2006, at 8:11 AM, qvx wrote:

>
> Hi list,
>
> I have an application written using TurboGears 0.9a5 and SQLAlchemy
> 0.1.5. I'm currently trying to upgrade to latest SQLAlchemy 0.3.0 (and
> TG 1.0)
>
> My problem is with session management. I have to use up to 4 database
> connections, but not all of them every time. Previously, everything  
> was
> working fine because the wrapper transaction function looked like this
> (simplified):
>
> def run_with_transaction(func, *args, **kw):
>     # flush any cached objects
>     sqlalchemy.objectstore.clear()
>     retval = func(*args, **kw)
>     sqlalchemy.objectstore.commit()
>
> Now, because there is no more sqlalchemy.objectstore, some explicit
> mechanism must be in place. Currently, this function looks like this
> (simplified):
>
> def sa_rwt(func, *args, **kw):
>     transaction = session.create_transaction()
>     retval = func(*args, **kw)
>     transaction.commit()
>
> This is capable of handling only one database connection.
>
> How can I simulate old behavior?
>
> I guess that this is not all because now there is a session.save()
> method which must be called for new objects.
>
> Thanks,
> Tvrtko
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy
-~----------~----~----~----~------~----~------~--~---

Reply via email to