There should be something else in your code causing the transaction to be
completed before the transaction manager tries to commit it.
Do your models have any even listener or something else that might be
trying to commit changes before the end of the request? In TG2 unless the
transaction manager is disabled you should never commit or rollback the
transaction yourself, you let it go or you doom it.



On Thu, May 11, 2017 at 7:30 PM, D R Dinesh Kumar <[email protected]>
wrote:

> Hi All,
>
> I am using the following statement to create DB session
>
> maker = sessionmaker(autoflush=True, autocommit=False,
>                       extension=ZopeTransactionExtension())
> DBSession = scoped_session(maker)
>
> and in my app, I have created model view admin controllers for user,group
> etc.
> when I try to edit users, I am hitting the following issue.
>
> File "/remote/vtghome9/vgtools2/VPython2.7.13/lib/python2.7/
> site-packages/transaction/_transaction.py", line 423, in _commitResources
> rm.tpc_vote(self)
> File "/remote/vtghome9/vgtools2/VPython2.7.13/lib/python2.7/
> site-packages/zope/sqlalchemy/datamanager.py", line 109, in tpc_vote
> self.tx.commit()
> File "/remote/vtghome9/vgtools2/VPython2.7.13/lib/python2.7/
> site-packages/sqlalchemy/orm/session.py", line 459, in commit
> self._assert_active(prepared_ok=True)
> File "/remote/vtghome9/vgtools2/VPython2.7.13/lib/python2.7/
> site-packages/sqlalchemy/orm/session.py", line 285, in _assert_active
> raise sa_exc.ResourceClosedError(closed_msg)
> ResourceClosedError: This transaction is closed
>
> Any help is greatly appreciated.!!
>
> Possible issue:: Since ZTE is used, calling .commit() explicitly is not
> required.
>
> is there a way to handle this to create different session (without ZTE)
> for AdminController to use?
>
> With Regards,
> Dinesh.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/turbogears.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to