On 8/22/06, jerojasro <[EMAIL PROTECTED]> wrote:
> I have migrated a project from SQLObject to SQLAlchemy. I'm getting
> ever since several messages in the TG console, like this one

I'm also getting this but I'm getting it in a quickstarted project.
Doing some print debugging, I import thread into savisit.py. I did one
pair of log statements in the __init__, one at the start of the
visit_for_key method, and one at the start of the
update_queued_visits. The attached log file shows the server startup,
one hit on the server, waiting for the identity to expire, then
shutdown. I put in a bind_meta_data() call just after the log
statements in visit_for_key or it throws a not bound error. The key
values are the thread ids, as that's what sqlalchemy's threadlocal
implementation is using to hash the connections.

Unfortunately, I can't figure out how to correlate the high level
Thread objects from threading with the get_ident() provided by the low
level thread module. I also don't have any good ideas on how to ensure
that all the threads get a bound engine.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
2006-08-23 22:12:43,114 turbogears.controllers DEBUG Exposing <function index at 0xb74cd304>
2006-08-23 22:12:43,114 turbogears.controllers DEBUG template: testproj.templates.welcome, format: None, allow_json: None, content-type: None
2006-08-23 22:12:43,115 turbogears.controllers DEBUG Exposing <function login at 0xb74cd534>
2006-08-23 22:12:43,115 turbogears.controllers DEBUG template: testproj.templates.login, format: None, allow_json: None, content-type: None
2006-08-23 22:12:43,116 turbogears.controllers DEBUG Exposing <function logout at 0xb74cd72c>
2006-08-23 22:12:43,116 turbogears.controllers DEBUG template: json, format: None, allow_json: True, content-type: None
2006-08-23 22:12:43,116 turbogears.startup DEBUG I am the server start thread! -1209706272
2006-08-23 22:12:44,443 turbogears.controllers DEBUG Exposing <function index at 0xb73ea304>
2006-08-23 22:12:44,443 turbogears.controllers DEBUG template: testproj.templates.welcome, format: None, allow_json: None, content-type: None
2006-08-23 22:12:44,443 turbogears.controllers DEBUG Exposing <function login at 0xb73ea534>
2006-08-23 22:12:44,443 turbogears.controllers DEBUG template: testproj.templates.login, format: None, allow_json: None, content-type: None
2006-08-23 22:12:44,444 turbogears.controllers DEBUG Exposing <function logout at 0xb73ea72c>
2006-08-23 22:12:44,444 turbogears.controllers DEBUG template: json, format: None, allow_json: True, content-type: None
2006-08-23 22:12:44,445 turbogears.startup DEBUG I am the server start thread! -1210636064
2006-08-23 22:12:44,445 turbogears.startup DEBUG I am the reloader thread! -1210636064
2006-08-23 22:12:44,447 cherrypy.msg INFO CONFIG: Server parameters:
2006-08-23 22:12:44,447 cherrypy.msg INFO CONFIG:   server.environment: development
2006-08-23 22:12:44,447 cherrypy.msg INFO CONFIG:   server.log_to_screen: True
2006-08-23 22:12:44,448 cherrypy.msg INFO CONFIG:   server.log_file: 
2006-08-23 22:12:44,448 cherrypy.msg INFO CONFIG:   server.log_tracebacks: True
2006-08-23 22:12:44,448 cherrypy.msg INFO CONFIG:   server.log_request_headers: True
2006-08-23 22:12:44,448 cherrypy.msg INFO CONFIG:   server.protocol_version: HTTP/1.0
2006-08-23 22:12:44,449 cherrypy.msg INFO CONFIG:   server.socket_host: 
2006-08-23 22:12:44,449 cherrypy.msg INFO CONFIG:   server.socket_port: 8080
2006-08-23 22:12:44,449 cherrypy.msg INFO CONFIG:   server.socket_file: 
2006-08-23 22:12:44,449 cherrypy.msg INFO CONFIG:   server.reverse_dns: False
2006-08-23 22:12:44,449 cherrypy.msg INFO CONFIG:   server.socket_queue_size: 5
2006-08-23 22:12:44,450 cherrypy.msg INFO CONFIG:   server.thread_pool: 1
2006-08-23 22:12:44,459 turbogears.view DEBUG Loading base templates
2006-08-23 22:12:44,469 turbogears.visit INFO Visit Tracking starting
2006-08-23 22:12:44,470 turbogears.visit DEBUG Loading visit manager from plugin: sqlalchemy
2006-08-23 22:12:44,486 turbogears.identity.savisit DEBUG I am created! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1221108816
2006-08-23 22:12:44,486 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <_DummyThread(Dummy-1, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <Thread(expireCache, started daemon)>]
2006-08-23 22:12:44,487 turbogears.visit INFO Visit filter initialised
2006-08-23 22:12:44,489 turbogears.identity INFO Identity starting
2006-08-23 22:12:44,489 turbogears.identity DEBUG Loading provider from plugin: sqlalchemy
2006-08-23 22:12:44,493 turbogears.identity.saprovider INFO Loading: testproj.model.VisitIdentity
2006-08-23 22:12:44,493 turbogears.identity INFO Identity visit plugin initialised
2006-08-23 22:12:44,493 turbogears.identity DEBUG Loading provider from plugin: sqlalchemy
2006-08-23 22:12:44,495 turbogears.identity.saprovider INFO Loading: testproj.model.VisitIdentity
2006-08-23 22:12:44,697 cherrypy.msg INFO HTTP: Serving HTTP on http://localhost:8080/
2006-08-23 22:13:12,565 turbogears.identity.savisit DEBUG Start of visit_for_key! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1255539792
2006-08-23 22:13:12,565 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <Thread(CPHTTPServer Thread-2, started daemon)>, <Thread(expireCache, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <WorkerThread(CP WSGIServer Thread-3, started daemon)>, <_DummyThread(Dummy-1, started daemon)>]
2006-08-23 22:13:12,616 turbogears.identity DEBUG Retrieving identity for visit: b0beaa1d8c3d37ad6fac315d440e7d0f01478988
2006-08-23 22:13:12,617 turbogears.identity INFO Identity is available...
2006-08-23 22:13:12,620 turbogears.controllers DEBUG Generated rule kw.get("tg_format", "default") == "default"
2006-08-23 22:13:12,621 turbogears.database DEBUG New SA transaction
2006-08-23 22:13:12,622 turbogears.controllers DEBUG Calling <function index at 0xb73ea304> with *((<testproj.controllers.Root object at 0xb73812ec>,)), **({})
2006-08-23 22:13:12,622 testproj.controllers DEBUG Happy TurboGears Controller Responding For Duty
2006-08-23 22:13:12,622 testproj.controllers DEBUG Happy TurboGears Controller Responding For Duty
2006-08-23 22:13:12,623 turbokid.kidsupport DEBUG Compiling template for turbogears.view.templates.sitetemplate
2006-08-23 22:13:12,624 turbokid.kidsupport DEBUG Compiling template for testproj.templates.welcome
2006-08-23 22:13:12,626 turbokid.kidsupport DEBUG Applying template testproj.templates.welcome
127.0.0.1 - - "GET / HTTP/1.1" 200 3251 "" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060626 Firefox/1.5.0.5 (Debian-1.5.dfsg+1.5.0.5-0bpo1)"
2006-08-23 22:13:12,840 turbogears.identity.savisit DEBUG Start of visit_for_key! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1255539792
2006-08-23 22:13:12,840 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <Thread(CPHTTPServer Thread-2, started daemon)>, <Thread(expireCache, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <WorkerThread(CP WSGIServer Thread-3, started daemon)>, <_DummyThread(Dummy-1, started daemon)>]
2006-08-23 22:13:12,843 turbogears.identity DEBUG Retrieving identity for visit: b0beaa1d8c3d37ad6fac315d440e7d0f01478988
2006-08-23 22:13:12,843 turbogears.identity INFO Identity is available...
127.0.0.1 - - "GET /static/css/style.css HTTP/1.1" 304 - "http://localhost:8080/"; "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060626 Firefox/1.5.0.5 (Debian-1.5.dfsg+1.5.0.5-0bpo1)"
2006-08-23 22:13:13,055 turbogears.identity.savisit DEBUG Start of visit_for_key! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1255539792
2006-08-23 22:13:13,056 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <Thread(CPHTTPServer Thread-2, started daemon)>, <Thread(expireCache, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <WorkerThread(CP WSGIServer Thread-3, started daemon)>, <_DummyThread(Dummy-1, started daemon)>]
2006-08-23 22:13:13,058 turbogears.identity DEBUG Retrieving identity for visit: b0beaa1d8c3d37ad6fac315d440e7d0f01478988
2006-08-23 22:13:13,059 turbogears.identity INFO Identity is available...
127.0.0.1 - - "GET /static/images/under_the_hood_blue.png HTTP/1.1" 304 - "http://localhost:8080/"; "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060626 Firefox/1.5.0.5 (Debian-1.5.dfsg+1.5.0.5-0bpo1)"
2006-08-23 22:13:13,274 turbogears.identity.savisit DEBUG Start of visit_for_key! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1255539792
2006-08-23 22:13:13,274 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <Thread(CPHTTPServer Thread-2, started daemon)>, <Thread(expireCache, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <WorkerThread(CP WSGIServer Thread-3, started daemon)>, <_DummyThread(Dummy-1, started daemon)>]
2006-08-23 22:13:13,277 turbogears.identity DEBUG Retrieving identity for visit: b0beaa1d8c3d37ad6fac315d440e7d0f01478988
2006-08-23 22:13:13,277 turbogears.identity INFO Identity is available...
127.0.0.1 - - "GET /static/images/header_inner.png HTTP/1.1" 304 - "http://localhost:8080/static/css/style.css"; "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060626 Firefox/1.5.0.5 (Debian-1.5.dfsg+1.5.0.5-0bpo1)"
2006-08-23 22:13:13,285 turbogears.identity.savisit DEBUG Start of visit_for_key! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1255539792
2006-08-23 22:13:13,285 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <Thread(CPHTTPServer Thread-2, started daemon)>, <Thread(expireCache, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <WorkerThread(CP WSGIServer Thread-3, started daemon)>, <_DummyThread(Dummy-1, started daemon)>]
2006-08-23 22:13:13,288 turbogears.identity DEBUG Retrieving identity for visit: b0beaa1d8c3d37ad6fac315d440e7d0f01478988
2006-08-23 22:13:13,288 turbogears.identity INFO Identity is available...
127.0.0.1 - - "GET /static/images/ok.png HTTP/1.1" 304 - "http://localhost:8080/static/css/style.css"; "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060626 Firefox/1.5.0.5 (Debian-1.5.dfsg+1.5.0.5-0bpo1)"
2006-08-23 22:13:13,295 turbogears.identity.savisit DEBUG Start of visit_for_key! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1255539792
2006-08-23 22:13:13,295 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <Thread(CPHTTPServer Thread-2, started daemon)>, <Thread(expireCache, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <WorkerThread(CP WSGIServer Thread-3, started daemon)>, <_DummyThread(Dummy-1, started daemon)>]
2006-08-23 22:13:13,298 turbogears.identity DEBUG Retrieving identity for visit: b0beaa1d8c3d37ad6fac315d440e7d0f01478988
2006-08-23 22:13:13,299 turbogears.identity INFO Identity is available...
127.0.0.1 - - "GET /static/images/info.png HTTP/1.1" 304 - "http://localhost:8080/static/css/style.css"; "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060626 Firefox/1.5.0.5 (Debian-1.5.dfsg+1.5.0.5-0bpo1)"
2006-08-23 22:13:14,498 turbogears.identity.savisit DEBUG Start of update_queued_visits! I am a <class 'turbogears.visit.savisit.SqlAlchemyVisitManager'> at -1220906068 in thread -1238336592
2006-08-23 22:13:14,498 turbogears.identity.savisit DEBUG Current threads: [<_MainThread(MainThread, started)>, <Thread(CPHTTPServer Thread-2, started daemon)>, <Thread(expireCache, started daemon)>, <SqlAlchemyVisitManager(VisitManager, started daemon)>, <WorkerThread(CP WSGIServer Thread-3, started daemon)>, <_DummyThread(Dummy-1, started daemon)>]
2006-08-23 22:13:14,498 turbogears.identity.savisit INFO updating visit (b0beaa1d8c3d37ad6fac315d440e7d0f01478988) to expire at 2006-08-23 22:33:13.298766
Exception in thread VisitManager:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/home/kguertin/dev/turbogears/turbogears/visit/api.py", line 256, in run
    self.update_queued_visits(queue)
  File "/home/kguertin/dev/turbogears/turbogears/visit/savisit.py", line 67, in update_queued_visits
    values={'expiry': expiry}).execute()
  File "/home/kguertin/dev/sqlalchemy/lib/sqlalchemy/sql.py", line 516, in execute
    return self.execute_using(self.engine, *multiparams, **params)
  File "/home/kguertin/dev/sqlalchemy/lib/sqlalchemy/sql.py", line 470, in execute_using
    return self.compile(engine=engine, parameters=compile_params).execute(*multiparams, **params)
  File "/home/kguertin/dev/sqlalchemy/lib/sqlalchemy/sql.py", line 381, in execute
    raise exceptions.InvalidRequestError("This Compiled object is not bound to any engine.")
InvalidRequestError: This Compiled object is not bound to any engine.

2006-08-23 22:13:29,443 cherrypy.msg INFO ENGINE: <Ctrl-C> hit: shutting down autoreloader
2006-08-23 22:13:29,444 cherrypy.msg INFO HTTP: HTTP Server shut down
2006-08-23 22:13:29,446 turbogears.visit INFO Visit Tracking shutting down
2006-08-23 22:13:29,447 cherrypy.msg INFO ENGINE: <Ctrl-C> hit: shutting down autoreloader
2006-08-23 22:13:29,449 turbogears.identity INFO Identity shutting down
2006-08-23 22:13:29,449 cherrypy.msg INFO ENGINE: CherryPy shut down
2006-08-23 22:13:29,482 cherrypy.msg INFO HTTP: HTTP Server shut down
2006-08-23 22:13:29,485 turbogears.visit INFO Visit Tracking shutting down
2006-08-23 22:13:29,507 turbogears.identity INFO Identity shutting down
2006-08-23 22:13:29,507 cherrypy.msg INFO ENGINE: CherryPy shut down

Reply via email to