Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-2.dfn.de!news.dfn.de!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.06; 'explicit': 0.07; 'session.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'thread': 0.14; '"classic"': 0.16; 'orm,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'received:zen.co.uk': 0.16; 'sqlalchemy': 0.16; 'subject:ORM': 0.16; 'subject:library': 0.16; 'wrote:': 0.18; 'memory': 0.22; 'header:User-Agent:1': 0.23; 'instead.': 0.24; "i've": 0.25; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'that.': 0.31; 'but': 0.35; 'object,': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'too': 0.37; 'ends': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'email addr:gmail.com': 0.63; 'subject:read': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lie Ryan Subject: Re: Python ORM library for distributed mostly-read-only objects? Date: Mon, 23 Jun 2014 16:54:38 +0100 References: <85659fdd-511b-4aea-9c4b-17a4bbb88662@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 82-69-92-136.dsl.in-addr.zen.co.uk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <85659fdd-511b-4aea-9c4b-17a4bbb88662@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 7 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1403538899 news.xs4all.nl 2899 [2001:888:2000:d::a6]:55407 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73516 On 22/06/14 10:46, smurfix@gmail.com wrote: > > I've been doing this with a "classic" session-based SQLAlchemy ORM, approach, but that ends up way too slow and memory intense, as each thread gets its own copy of every object it needs. I don't want that. If you don't want each thread to have their own copy of the object, Don't use thread-scoped session. Use explicit scope instead.