Hello,

I am using SQLA 0.5rc2 on Py 2.5.2 with Elixir 0.6. I have a multithreaded
application, and each thread gets a separate session object. All of them use
the same disk based database. I get the below exception :

Exception in thread RSIHostDBSync:
Traceback (most recent call last):
  File "c:\python25\lib\threading.py", line 486, in __bootstrap_inner
    self.run()
  File "O:\RecogSys\src\python\RSITerm\RSIHostDBSync.py", line 978, in run
    InteractionsSent, InteractionsRemaining = self.SendInteractions()
  File "O:\RecogSys\src\python\RSITerm\RSIHostDBSync.py", line 1366, in
SendInte
ractions
    iaKeyList = list(self.rsiDB.InteractionDB().keys())
  File "O:\RecogSys\src\python\RSITerm\SQLConvert\InteractionDBDict.py",
line 24
, in keys
    return self.dbo.InteractionDBDict_Keys()
  File "O:\RecogSys\src\python\RSITerm\SQLConvert\SqlDB.py", line 1045, in
Inter
actionDBDict_Keys
    filter_by(SentFlag = 0).all():
  File
"c:\python25\lib\site-packages\sqlalchemy-0.5.0rc2-py2.5.egg\sqlalchemy\o
rm\query.py", line 990, in all
    return list(self)
  File
"c:\python25\lib\site-packages\sqlalchemy-0.5.0rc2-py2.5.egg\sqlalchemy\o
rm\query.py", line 1078, in __iter__
    return self._execute_and_instances(context)
  File
"c:\python25\lib\site-packages\sqlalchemy-0.5.0rc2-py2.5.egg\sqlalchemy\o
rm\query.py", line 1081, in _execute_and_instances
    result = self.session.execute(querycontext.statement,
params=self._params, m
apper=self._mapper_zero_or_none(), _state=self._refresh_state)
  File
"c:\python25\lib\site-packages\sqlalchemy-0.5.0rc2-py2.5.egg\sqlalchemy\o
rm\session.py", line 749, in execute
    return self.__connection(engine, close_with_result=True).execute(
  File
"c:\python25\lib\site-packages\sqlalchemy-0.5.0rc2-py2.5.egg\sqlalchemy\o
rm\session.py", line 716, in __connection
    return self.transaction._connection_for_bind(engine)
  File
"c:\python25\lib\site-packages\sqlalchemy-0.5.0rc2-py2.5.egg\sqlalchemy\o
rm\session.py", line 309, in _connection_for_bind
    self._assert_is_active()
  File
"c:\python25\lib\site-packages\sqlalchemy-0.5.0rc2-py2.5.egg\sqlalchemy\o
rm\session.py", line 244, in _assert_is_active
    "The transaction is inactive due to a rollback in a "
InvalidRequestError: The transaction is inactive due to a rollback in a
subtrans
action.  Issue rollback() to cancel the transaction.

I am guarding my commits with a mutex, but the queries are unguarded. Before
I get the above exception, I dont see any other messages regarding the
transaction rollback that is mentioned here before this exception occurs.
Could this be a problem with the way I have implemented sessions? If one of
the session is committing on the database and the other one is trying to
query, would this problem arise? I am not very sure on how connection
objects are created during this scenario. Appreciate your help.

Regards,
Harish

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to