I use python0.97beta3 with elixir5.

when I add a new item into database , then refresh the web page,

sometimes the new item will show and sometimes not show .

if i restart the web server , it always can return the truely result .

how to fix this ?

##########################
#model.__init__
##########################
from sqlalchemy import orm

Session = orm.scoped_session(orm.sessionmaker(autoflush=True,
transactional=True))
elixir.session = Session

def init_model(engine):

    elixir.metadata.bind=engine
    elixir.setup_all()

##########################
#lib.base
##########################
from pylons.controllers import WSGIController
from zsite.model import Session

class BaseController(WSGIController):

    def __call__(self, environ, start_response):
        try:
            return WSGIController.__call__(self, environ, start_response)
        finally:
            Session.remove()


-- 
博客:http://zsp.javaeye.com/
个人网站:http://zsp007.com.cn/
电子科大,7月就要毕业了,何去何从...
双学位:生物医学工程+计算机科学与技术
 -- 张教主

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to