freenode/#lisp - IRC Chatlog
Search
9:23:27
iissaacc
has anyone else noticed issues with postmodern's with-connection macro seemingly not releasing a connection?
9:27:24
phoe
https://github.com/marijnh/Postmodern/blob/8a44fd6d27dfa44be321bd647fc1d6ca6a2b8c9f/postmodern/connect.lisp#L96-L101
9:29:05
iissaacc
well, I used a couple of functions with a with-connection in them, they ended, but then i go to try and drop the test database that i created and i get an error telling me it is in use
9:29:49
iissaacc
checking pg_stat_activity shows 2 idle connections from the user i specified in the with-connection parameters
9:30:42
no-defun-allowed
Could there be another meaning of "in use", like that the table is being used by a view or something? I haven't gotten deep into SQL to say anything for sure.
9:31:08
phoe
can you try to reproduce it? are you sure that you did not do any toplevel connections from the REPL, or that you reassigned the value of POSTMODERN:*DATABASE*?
9:32:41
phoe
docstring for method DISCONNECT (DATABASE-CONNECTION): "Disconnects a normal database connection, or moves a pooled connection into the pool."
9:33:46
no-defun-allowed
But I still wonder if that's the problem; if the connections aren't being used for anything, why would they prevent a table from being dropped?
9:34:31
phoe
you connect to a particular database, so you can't destroy the database while there's still something connected to it
9:39:32
pve
iissaacc: in case your wondering about the quality of postmodern, I've used it quite a bit and found it very reliable
9:40:16
iissaacc
it's the first time i've done any sql really so im working on the theory that any problems are probably the result of my own ignorance
9:41:11
pve
when it comes to postmodern (and postgresql for that matter), any weirdness has always been my own fault