Ok, I've found the following local hack:

        db_session.registry().extensions[:] = []
        db_session.commit()

Another possibility is to permanently disable the assert() against
db_session.commit (in model/__init__.py):

class _TransactionExtension(ZopeTransactionExtension):
    def before_commit(self, session):
        pass

# Global session manager.  db_session() returns the session object
# appropriate for the current web request.
maker = sessionmaker(autoflush=True, autocommit=False,
                     extension=_TransactionExtension())



On Jun 1, 8:45 pm, Antoine Pitrou <[email protected]> wrote:
> Hello,
>
> When doing transaction.commit(), the current ORM session is close()d,
> which means you have to refetch all objects which were contained in
> this session. This is quite annoying, and I would want to bypass this
> behaviour in some places of my unit tests. Is there anyway of doing so
> without disabling the transaction manager?
>
> Regards
>
> Antoine.
--~--~---------~--~----~------------~-------~--~----~
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