Chris Curvey wrote:
> Hey folks, it's me again!  (I will wait for the groans to
> subside....good.)
>
> I've got two issues, both related to (I think) connection pooling.
> I'm using Elixir with Pylons.
>
> The first issue is that I'm still seeing "old" data show up on my web
> pages.  I have some background tasks that are updating the database,
> and if I keep hitting "refresh" in my web browser, the data on the web
> page seems to go backwards in time.
>   
sounds like an SA session issue. i.e it's not being cleared before use. 
I saw your code where you clear it on request start, but you have to 
make sure that session object is the same as the one you are using later 
on in your code (trying printing out it's id before using it and also 
before clearing it).

I'm not familiar with Elixir, but is the Session a threadlocal ?
> The second issue is that if the database (Postgres) has a problem with
> one of my SQL statements (foreign key violation, duplicate key
> problem), the connection is left in a state where you have to execute
> a "rollback" before anything else can happen.   Which causes all
> future requests that happen to get that DB connection to fail.  The
> only way I've found to fix the problem is to restart my app server.
>   
This sounds like the Session has transactional=True. When this is set, I 
think the Session automatically starts a transaction for you. So when an 
error occurs, you have to rollback yourself.

I am not familiar with Elixir at all, only SA. Maybe you should try 
plain SA if problems persist.

Regards

Huy
> So...does anyone have a recipe for what I should be doing at the start
> of each request to make sure i have a clean DB connection?  (Or
> something that should be done at the end of each request to clean up
> after myself?)
>
> >   


--~--~---------~--~----~------------~-------~--~----~
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