A transaction is already begun. Use subtransactions=True to allow subtransactions.

1,819 views
Skip to first unread message

jo

unread,
Jan 17, 2013, 4:50:18 AM1/17/13
to sa
Hi all,

I'm running an web application in turbogears1 using sqlalchemy I'm using mainly postgresql as database
but in a few installations I'm using oracle (same programs only db change).
Using PostgreSQL all is ok but when I use
oracle some times I get the following error:

File "/sferacarta/prod/eggs/TurboGears-1.1.1-py2.6.egg/turbogears/database.py", line 455, in sa_rwt
request.sa_transaction = session.begin()
File "/sferacarta/prod/eggs/SQLAlchemy-0.6.8-py2.6.egg/sqlalchemy/orm/scoping.py", line 139, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/sferacarta/prod/eggs/SQLAlchemy-0.6.8-py2.6.egg/sqlalchemy/orm/session.py", line 550, in begin
"A transaction is already begun. Use subtransactions=True "
InvalidRequestError: A transaction is already begun. Use subtransactions=True to allow subtransactions.

I'm not using explicity session.begin() because turbogears do that for me,
thus I don't know where to define subtransactions=True.
What can I do?

thanks for any help

j


Michael Bayer

unread,
Jan 17, 2013, 10:32:30 AM1/17/13
to sqlal...@googlegroups.com
you shouldn't have to deal with "subtransactions" in any case and this seems like a bug in turbogears. Especially, there should be no difference at all in session handling between two different database backends - it suggests they might have "oracle" hardcoded somewhere though that would be very strange. you should ask on their list.
Reply all
Reply to author
Forward
0 new messages