SQLAlchemy + RPC

96 views
Skip to first unread message

David Siroky

unread,
Oct 26, 2006, 8:24:15 AM10/26/06
to sqlal...@googlegroups.com
Hi!

I'm looking for a solution where I can use ORM via a RPC calls (PyRO,
xml-rpc, ...). I'm creating a client-server application and the scenario
is:

(my client) <-> (my server) <-> (database)

where the server will be only a some kind of DB proxy. I don't want the
client programs to access the database directly but via my server and I
would like have also some access control in the server (e.g. some
clients can access only some rows in some tables...). That is for the
case that someone will reverse engineer my client-server authentication
and will get full access to the database.

I hope I didn't describe it in a very confusing way :-)

Thanks for any advice or clue.

David

iGL

unread,
Oct 26, 2006, 12:15:37 PM10/26/06
to sqlalchemy
Hi,
A scenario and a basic implementation of what you're looking for is
described in "Python and XML", Chaper 10 - "Python and Distributed
Systems Design" (
http://www.amazon.com/Python-XML-Christopher-Jones/dp/0596001282/sr=8-1/qid=1161878666/ref=pd_bbs_sr_1/002-2193540-4657636?ie=UTF8&s=books
); this book is published as early as in 2001 and might well be
outdated otherwise, though.
Another option could be to build the server-mediator upon sqlite DB and
make it mirror a DB server.
HTH - I haven't myself found a ready-to-use lib for making that
stuff...
Best wishes,
Giorgi

David Siroky

unread,
Oct 27, 2006, 10:26:20 AM10/27/06
to sqlal...@googlegroups.com
Thanks.

I solved it by exposing connection and cursor objects via a Pyro. I
don't have any access control for individual rows in tables but it
doesn't matter for now.
But I have a different problem now. I have a simple pool on the server
side where I'm storing connections and cursors and it is growing without
closing any cursors or connections. When does the SA call .close() on
cursors or connections?

DS


iGL píše v Čt 26. 10. 2006 v 16:15 +0000:

iGL

unread,
Oct 27, 2006, 10:52:38 AM10/27/06
to sqlalchemy
Hi,
the engine connections are actually destroyed by garbage collections.
This should happen as soon as the object is not referred anymore; thus,
one must explicitly close any connection.
It's stated so here:
http://www.sqlalchemy.org/docs/dbengine.myt#dbengine_connections - SA
0.3
as well as here:
http://www.sqlalchemy.org/docs_02/dbengine.myt#dbengine_connections -
SA 0.2.8

HTH,
Giorgi

Reply all
Reply to author
Forward
0 new messages