exception happing while re-directing in cherrypy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

exception happing while re-directing in cherrypy

reetesh nigam

Hi All,

I have developed one project. In which I have two user controls. I am
use cherrypy session control for session management.
I am getting the following exception in database.py file of python and
after that I am getting the integrity error:

8/9/2009 10:03:08 AM [controllers.py] - [ 608] [DEBUG] redirecting to /
admin/
8/9/2009 10:03:08 AM [database.py] - [ 409] [DEBUG] this is only a
redirect
8/9/2009 10:03:08 AM [database.py] - [ 432] [DEBUG] Restarting SA
transaction
8/9/2009 10:03:08 AM [database.py] - [ 416] [DEBUG] this is an
exception, ROLLBACK now!
8/9/2009 10:03:08 AM [mysession.py] - [ 130] [DEBUG] saving session:
b61d4b92ae51472ea9aa4c98d03bf44dc3362172
8/9/2009 10:03:08 AM [mysession.py] - [ 168] [DEBUG]
===========================Exiting request at Sun Aug 09 10:03:08 2009
number 107 =========
8/9/2009 10:03:08 AM [controllers.py] - [ 473] [INFO ] 127.0.0.1 - -
"POST /login HTTP/1.0" 302 99 "http://192.168.0.25/login" "Mozilla/4.0
(compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR
2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; OfficeLiveConnector.
1.3; OfficeLivePatch.0.0; .NET CLR 3.0.30729)"
8/9/2009 10:03:09 AM [ourerrorhandler.py] - [  60] [ERROR]
error:<class 'sqlalchemy.exceptions.IntegrityError'> trace:Traceback
(most recent call last):
  File "c:\python25\lib\site-packages\cherrypy-2.2.1-py2.5.egg\cherrypy
\_cphttptools.py", line 105, in _run
    self.main()
  File "c:\python25\lib\site-packages\cherrypy-2.2.1-py2.5.egg\cherrypy
\_cphttptools.py", line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in login
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\controllers.py", line 344, in expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\database.py", line 406, in sa_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\controllers.py", line 359, in <lambda>
    mapping, fragment, args, kw)))
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\controllers.py", line 386, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\errorhandling.py", line 72, in try_call
    return func(self, *args, **kw)
  File "build\bdist.win32\egg\radspeed\controllers.py", line 597, in
login
  File "build\bdist.win32\egg\radspeed\mysession.py", line 225, in
makenewsession
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\scoping.py", line 98, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\session.py", line 764, in flush
    self.uow.flush(self, objects)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 233, in flush
    flush_context.execute()
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 455, in execute
    UOWExecutor().execute(self, tasks)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 945, in execute
    self.execute_save_steps(trans, task)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 960, in execute_save_steps
    self.save_objects(trans, task)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 951, in save_objects
    task.mapper._save_obj(task.polymorphic_tosave_objects, trans)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\mapper.py", line 1096, in _save_obj
    c = connection.execute(statement.values(value_params), params)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 846, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 897, in execute_clauseelement
    return self._execute_compiled(elem.compile(dialect=self.dialect,
column_keys=keys, inline=len(params) > 1), distilled_params=params)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 909, in _execute_compiled
    self.__execute_raw(context)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 918, in __execute_raw
    self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 962, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 944, in _handle_dbapi_exception
    raise exceptions.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
IntegrityError: ('(IntegrityError) (1062, "Duplicate entry
\'b61d4b92ae51472ea9aa4c98d03bf44dc3362172\' for key \'PRIMARY\'")',
<bound method Root.login of <radspeed.controllers.Root object at
0x01A32710>>) u'INSERT INTO t_activesessions (`sessionId`,
physician_login, `createdTime`, `lastAcessTime`, `updatedBy`,
clientip, data, `macAddress`) VALUES (%s, %s, %s, %s, %s, %s, %s,
%s)' ['b61d4b92ae51472ea9aa4c98d03bf44dc3362172', u'admin',
datetime.datetime(2009, 8, 9, 10, 3, 8, 625000), datetime.datetime
(2009, 8, 9, 10, 3, 8, 625000), 'webui', '192.168.0.207',
"(dp0\nS'_id'\np1\nS'b61d4b92ae51472ea9aa4c98d03bf44dc3362172'\np2\ns.",
None]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-devel" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-devel
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: exception happing while re-directing in cherrypy

reetesh nigam




---------- Forwarded message ----------
From: reetesh nigam <[hidden email]>
Date: Aug 10, 10:32 pm
Subject: exception happing while re-directing in cherrypy
To: cherrypy-devel


Hi All,

I have developed one project. In which I have two user controls. I am
use cherrypy session control for session management.
I am getting the following exception in database.py file of python and
after that I am getting the integrity error:

8/9/2009 10:03:08 AM [controllers.py] - [ 608] [DEBUG] redirecting
to /
admin/
8/9/2009 10:03:08 AM [database.py] - [ 409] [DEBUG] this is only a
redirect
8/9/2009 10:03:08 AM [database.py] - [ 432] [DEBUG] Restarting SA
transaction
8/9/2009 10:03:08 AM [database.py] - [ 416] [DEBUG] this is an
exception, ROLLBACK now!
8/9/2009 10:03:08 AM [mysession.py] - [ 130] [DEBUG] saving session:
b61d4b92ae51472ea9aa4c98d03bf44dc3362172
8/9/2009 10:03:08 AM [mysession.py] - [ 168] [DEBUG]
===========================Exiting request at Sun Aug 09 10:03:08 2009
number 107 =========
8/9/2009 10:03:08 AM [controllers.py] - [ 473] [INFO ] 127.0.0.1 - -
"POST /login HTTP/1.0" 302 99 "http://192.168.0.25/login" "Mozilla/4.0
(compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR
2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; OfficeLiveConnector.
1.3; OfficeLivePatch.0.0; .NET CLR 3.0.30729)"
8/9/2009 10:03:09 AM [ourerrorhandler.py] - [  60] [ERROR]
error:<class 'sqlalchemy.exceptions.IntegrityError'> trace:Traceback
(most recent call last):
  File "c:\python25\lib\site-packages\cherrypy-2.2.1-py2.5.egg
\cherrypy
\_cphttptools.py", line 105, in _run
    self.main()
  File "c:\python25\lib\site-packages\cherrypy-2.2.1-py2.5.egg
\cherrypy
\_cphttptools.py", line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in login
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\controllers.py", line 344, in expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\database.py", line 406, in sa_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\controllers.py", line 359, in <lambda>
    mapping, fragment, args, kw)))
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\controllers.py", line 386, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "c:\python25\lib\site-packages\TurboGears-1.0.4b3-py2.5.egg
\turbogears\errorhandling.py", line 72, in try_call
    return func(self, *args, **kw)
  File "build\bdist.win32\egg\radspeed\controllers.py", line 597, in
login
  File "build\bdist.win32\egg\radspeed\mysession.py", line 225, in
makenewsession
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\scoping.py", line 98, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\session.py", line 764, in flush
    self.uow.flush(self, objects)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 233, in flush
    flush_context.execute()
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 455, in execute
    UOWExecutor().execute(self, tasks)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 945, in execute
    self.execute_save_steps(trans, task)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 960, in execute_save_steps
    self.save_objects(trans, task)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\unitofwork.py", line 951, in save_objects
    task.mapper._save_obj(task.polymorphic_tosave_objects, trans)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\orm\mapper.py", line 1096, in _save_obj
    c = connection.execute(statement.values(value_params), params)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 846, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 897, in execute_clauseelement
    return self._execute_compiled(elem.compile(dialect=self.dialect,
column_keys=keys, inline=len(params) > 1), distilled_params=params)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 909, in _execute_compiled
    self.__execute_raw(context)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 918, in __execute_raw
    self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 962, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor)
  File "c:\python25\lib\site-packages\SQLAlchemy-0.4.4-py2.5.egg
\sqlalchemy\engine\base.py", line 944, in _handle_dbapi_exception
    raise exceptions.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
IntegrityError: ('(IntegrityError) (1062, "Duplicate entry
\'b61d4b92ae51472ea9aa4c98d03bf44dc3362172\' for key \'PRIMARY\'")',
<bound method Root.login of <radspeed.controllers.Root object at
0x01A32710>>) u'INSERT INTO t_activesessions (`sessionId`,
physician_login, `createdTime`, `lastAcessTime`, `updatedBy`,
clientip, data, `macAddress`) VALUES (%s, %s, %s, %s, %s, %s, %s,
%s)' ['b61d4b92ae51472ea9aa4c98d03bf44dc3362172', u'admin',
datetime.datetime(2009, 8, 9, 10, 3, 8, 625000), datetime.datetime
(2009, 8, 9, 10, 3, 8, 625000), 'webui', '192.168.0.207',
"(dp0\nS'_id'\np1\nS'b61d4b92ae51472ea9aa4c98d03bf44dc3362172'\np2\ns.",
None]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-devel" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-devel
-~----------~----~----~----~------~----~------~--~---

Loading...