On Jun 13, 9:23 pm, Oveek <[email protected]> wrote: > Disregard what I said about the strange behavior. This commit looks to > be working perfectly, and in only 4 lines! I was originally confused > because I was still seeing multiple instances of the StoreSet being > initialized, but I was overlooking that one will be initialized for > each apache process as you mentioned below. I can verify the Store is > initialized only once per process, and the connection pool is being > reused. Also looks like the default pool size is 10, and not 5. When > there are a bunch of simultaneous requests, the numbers of connections > grows to accommodate them, then falls back to 10 connections once the > requests complete.
Unfortunately the stuff that is working just fine for mysql and postgres is not working just fine for sqlite. sqlite has its own special connection pooling class because it get confused in multi- threaded environments. After a few requests in CherryPy, it will start throwing InvalidRequestError or complain about a different thread trying to a use a connection existing in another thread. So I've done some rather baroque munging that seems to get around these issues, and may preserve the connection pooling, but I'm not sure. Check out my latest commits to both tiddlyweb and tiddlyweb- plugins/sqlstore. It changes the strategy a bit: a new store is created per request, otherwise sqlite gets thread confused. However in any given process, if we're not using sqlite, we should reuse a session object that is stored on the class (not the instance). > By the way, I've actually been running directly out of git. I pulled > in your commit, and in my tests never I encountered the > InvalidRequestError you mention in your following post. I don't know > where that would be coming from. Seems to be just sqlite. > Nice work, this appears to be working as intended. Connection pool is > definitely being reused. I'm going to do more testing tomorrow, but I > think you've nailed it. Again, that error in 0.9.39 is strange because > running against current git master I'm not having any problems. Thanks, let me know if the newest stuff does the right thing (even if differently). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" 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/TiddlyWikiDev?hl=en -~----------~----~----~----~------~----~------~--~---
