Hi Ian, The problem is, suppose I just open a store controller at the very beginning. If I execute either of the following:
(sb-thread:make-thread (lambda () (get-value "foobar" (get-from-root *my-btree-name* :sc *my-store-controller*)))) (sb-thread:make-thread (lambda () (get-value "foobar" *my-btree*))) there's a new connection in the database, never dying and eventually overflowing Postgresql's limit. (That is, "select count(*) from pg_stat_activity;" has a new row each time). A couple DB people at work looked at the ele-postmodern code, and they say they don't see the connection being closed down. I must be doing something wrong, but I can't see where... All the best, Tayssir Ian Eslick wrote: > with-open-store closes the store when you're done, null'ing out *store- > controller*. With sufficient concurrency you are likely to get a race > condition where the if stmt in with-city-store succeeds but the body > fails since you aren't locking access to *store-controller*. > > Ian > > > On Nov 20, 2008, at 11:16 AM, Tayssir John Gabbour wrote: >> Hi! >> >> With Elephant under both Postmodern and CLSQL, I'm consistently losing >> my DB connection. This apparently happens when writing from fairly >> simultaneous threads. (Two threads may write to the same btree key at >> around the same time.) >> >> All I do is add objects to a BTree, keyed by their UUID. (And there's >> two simple indexes.) No persistent metaclasses or anything; I just use >> it as a persistent table. >> >> Am I doing something terribly wrong? Code and error messages at the >> end of this email. _______________________________________________ elephant-devel site list elephant-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/elephant-devel