[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] GNUmed web interface - pyjamas

From: Sebastian Hilbert
Subject: Re: [Gnumed-devel] GNUmed web interface - pyjamas
Date: Mon, 12 Jul 2010 13:11:07 +0200
User-agent: KMail/1.13.3 (Linux/2.6.33-6-desktop; KDE/4.4.5; i686; ; )

Am Montag 12 Juli 2010, 09:36:43 schrieb Karsten Hilbert:
> On Sun, Jul 11, 2010 at 01:59:52PM -0700, lkcl wrote:
> >  so, one on the TODO list for you already: solve the psycopg2 problem, or
> In case you are using the GNUmed middleware - we only
> initiate two or so connections per thread.

I have incorporated lkcl's patch and published my work at

I can log in via localhost:8080 just fine.
When I try to run while the webbrowser session is active I get


[12/Jul/2010:12:04:52] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/cherrypy/", line 606, in 
    cherrypy.response.body = self.handler()
  File "/usr/lib/python2.6/site-packages/cherrypy/", line 25, in 
    return self.callable(*self.args, **self.kwargs)
  File "/home/basti/Sources/gnumed-
shilbert/gnumed/gnumed/Gnumed/CherryPy/", line 376, in services
    res = f(*kwargs['params'])
  File "/home/basti/Sources/gnumed-
shilbert/gnumed/gnumed/Gnumed/CherryPy/", line 388, in 
    return gmPG2.get_schema_version()
  File "/home/basti/Sources/gnumed-
shilbert/gnumed/gnumed/Gnumed/pycommon/", line 458, in 
    rows, idx = run_ro_queries(link_obj=link_obj, queries = [{'cmd': u'select 
md5(gm.concat_table_structure()) as md5'}])
  File "/home/basti/Sources/gnumed-
shilbert/gnumed/gnumed/Gnumed/pycommon/", line 970, in run_ro_queries
    conn = get_connection(readonly=True, verbose=verbose)
  File "/home/basti/Sources/gnumed-
shilbert/gnumed/gnumed/Gnumed/pycommon/", line 1271, in get_connection
    conn = __ro_conn_pool.getconn()
  File "/usr/lib/python2.6/site-packages/psycopg2/", line 215, in 
    return self._getconn(key)
  File "/usr/lib/python2.6/site-packages/psycopg2/", line 107, in 
    raise PoolError("connection pool exausted")
PoolError: connection pool exausted

When no other "session" is running all is fine as per below 

./ --ui=
Running from Git branch: * webui
GNUmed startup: Running from local source tree.
Adjusting PYTHONPATH ...
shilbert/gnumed/gnumed/Gnumed/pycommon/ DeprecationWarning: the 
MimeWriter module is deprecated; use the email package instead
  import urllib2 as wget, decimal, StringIO, MimeWriter, mimetypes, mimetools
[12/Jul/2010:12:30:57] ENGINE Listening for SIGHUP.
[12/Jul/2010:12:30:57] ENGINE Listening for SIGTERM.
[12/Jul/2010:12:30:57] ENGINE Listening for SIGUSR1.
[12/Jul/2010:12:30:57] ENGINE Bus STARTING
[12/Jul/2010:12:30:57] ENGINE Started monitor thread '_TimeoutMonitor'.
[12/Jul/2010:12:30:57] ENGINE Started monitor thread 'Autoreloader'.
[12/Jul/2010:12:30:58] ENGINE Serving on
[12/Jul/2010:12:30:58] ENGINE Bus STARTED
before_handler jsonrpc
json_string [{"params": ["any-doc", "any-doc"], "method": "login", "id": 2}]
echo service
{'params': [u'any-doc', u'any-doc'], 'method': u'login', 'id': 2} - - [12/Jul/2010:12:32:21] "POST /services HTTP/1.0" 200 40 "" 
" (by matt harrison)"
before_handler jsonrpc
json_string [{"params": [], "method": "get_schema_version", "id": 3}]
echo service
{'params': [], 'method': u'get_schema_version', 'id': 3} - - [12/Jul/2010:12:32:21] "POST /services HTTP/1.0" 200 117 "" 
" (by matt harrison)"
before_handler jsonrpc
json_string [{"params": [], "method": "get_doc_types", "id": 4}]
echo service
{'params': [], 'method': u'get_doc_types', 'id': 4} - - [12/Jul/2010:12:32:21] "POST /services HTTP/1.0" 200 836 "" 
" (by matt harrison)"

When I run again the connection pool exhausted error turns up 
as well.

As far as I can see for the two calls the error turns up 
because cherrypy has a connection established already from the first call.

The way out would be to hook into GNUmed's connection pool instead of calling 
the login function all the time.

What confuses me is the fact that you can log into the db with multiple 
wxpython clients at the same time. So it should be possible with multiple instances as well. 

Wait the problem is not but cherrypy being called (which 
already has an active connection) ? that would mean the cherrypy server stuff 
I wrote needs to be enhanced in the way that it allows multiple connections.

I am off to wrap my head arount it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]