[sqlalchemy] Re: transaction spanning multiple threads

2015-02-17 Thread Laurence Rowe
I'd recommend keeping the writes to a single thread if you can as that will be easiest. If you can't do that then you could tie them together using the transaction module's two phase commit and zope.sqlalchemy. As you want the same transaction shared across threads you'll want to create your

[sqlalchemy] Precompiled queries and .get(ident)

2014-12-02 Thread Laurence Rowe
I've been experimenting with precompiled queries in my app using the second recipe on https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/BakedQuery. I'm seeing a big speed up, with pages 30-40% faster (my application has graph structured content so some pages require ~100 items.) But

Re: [sqlalchemy] tying multiple sessions together with one transaction

2014-03-07 Thread Laurence Rowe
IIRC, the implementation of the two phase commit basically has everyone flush on Phase1, then report back as a vote. If there are any negative votes, the transaction manager instructs everyone to fail and rollback as Phase2. If you had a flush that caused an integrity error before

Re: [sqlalchemy] Anybody have twophase/zope.sqlalchemy/MySQL working?

2014-01-11 Thread Laurence Rowe
On Friday, 10 January 2014 08:06:16 UTC-8, Michael Bayer wrote: maybe. I was thinking, is the Session really doing the right thing here by not getting involved, but I think yeah that still might be appropriate. so we’d need to carry along some extra information about the transaction

Re: [sqlalchemy] Anybody have twophase/zope.sqlalchemy/MySQL working?

2014-01-10 Thread Laurence Rowe
On Thursday, 9 January 2014 09:41:40 UTC-8, Jeff Dairiki wrote: Okay, I've traced things out a bit more. If the session state is not STATUS_INVALIDATED (aka STATUS_CHANGED), SessionDataManager.commit() does a self._finish('no work'). That is where self.tx gets set to None (this ---

Re: [sqlalchemy] PostgreSQL: interval columns, values measured in months or years

2013-12-23 Thread Laurence Rowe
On Monday, 23 December 2013 06:38:41 UTC-8, Michael Bayer wrote: On Dec 23, 2013, at 9:29 AM, Sibylle Koczian nulla.e...@web.dejavascript: wrote: Am 21.12.2013 16:27, schrieb Michael Bayer: In the case of using Postgresql, the type sqlalchemy.dialects.postgresql.INTERVAL takes

Re: [sqlalchemy] Anybody have twophase/zope.sqlalchemy/MySQL working?

2013-12-23 Thread Laurence Rowe
On Thursday, 12 December 2013 15:26:08 UTC-8, Thierry Florac wrote: Hi, I'm using two-phase transactions with ZODB, PostgreSQL and Oracle databases connected with SQLAlchemy without problem. I'm not using native zope.sqlalchemy package, but another package called ztfy.alchemy that I've

Re: [sqlalchemy] Anybody have twophase/zope.sqlalchemy/MySQL working?

2013-12-23 Thread Laurence Rowe
On Thursday, 12 December 2013 16:30:59 UTC-8, Jeff Dairiki wrote: Do you understand why the datamanager is finding the SessionTransaction and using that directly? (At least I think that's what it's doing --- I haven't sussed this out completely.) I'm referring to the line from

Re: [sqlalchemy] Transactional DDL and SQLite?

2013-04-01 Thread Laurence Rowe
On Friday, 18 February 2011 08:14:28 UTC-8, Michael Bayer wrote: we've put tickets on their tracker to this effect, that they should be more liberal about considering when the transaction begins. http://code.google.com/p/pysqlite/issues/detail?id=21 pysqlite is tricky since I dont know if

[sqlalchemy] Help understanding database round trips

2013-03-26 Thread Laurence Rowe
I'd like to measure the number of database round trips that are associated with a request to my web application so I can write tests to catch potential performance regressions. I've been using mock.Mock(wraps=connection.execute) to keep count and while I think this works for selects, I don't

Re: [sqlalchemy] Help understanding database round trips

2013-03-26 Thread Laurence Rowe
On Tuesday, 26 March 2013 14:54:08 UTC-7, Michael Bayer wrote: On Mar 26, 2013, at 5:24 PM, Laurence Rowe lauren...@gmail.comjavascript: wrote: I'd like to measure the number of database round trips that are associated with a request to my web application so I can write tests

[sqlalchemy] zope.sqlalchemy 0.5 released

2010-06-07 Thread Laurence Rowe
I've just uploaded the 0.5 release of zope.sqlalchemy to PYPI, bringing SQLAlchemy 0.6 support. http://pypi.python.org/pypi/zope.sqlalchemy Savepoint release support (nested transaction commit) is currently being discussed on ZODB-dev:

[sqlalchemy] Re: session lifecycle and wsgi

2010-04-29 Thread Laurence Rowe
On Apr 28, 4:38 pm, Chris Withers ch...@simplistix.co.uk wrote: Laurence Rowe wrote: Chris, This is what the combination of repoze.tm2/transaction and zope.sqlalchemy does for you. You don't have to do anything special other than that. It doesn't do the .remove(). BFG currently has

[sqlalchemy] Re: session lifecycle and wsgi

2010-04-28 Thread Laurence Rowe
Chris, This is what the combination of repoze.tm2/transaction and zope.sqlalchemy does for you. You don't have to do anything special other than that. Laurence On Apr 28, 2:37 pm, Chris Withers ch...@simplistix.co.uk wrote: Hi All, I'm still trying to get an answer on this... Am I right in

[sqlalchemy] Savepoint release and nested transactions

2010-01-16 Thread Laurence Rowe
Hi, Following a request[1] for savepoint release support in zope.sqlalchemy, I've been looking into how this might be done. Adding the necessary support to Zope's transaction module was quite simple [2], but the mapping of Zope transaction savepoints - SQLAlchemy nested transactions - database

[sqlalchemy] Re: Savepoint release and nested transactions

2010-01-16 Thread Laurence Rowe
On Jan 16, 6:39 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jan 16, 2010, at 12:35 PM, Laurence Rowe wrote: Hi, Following a request[1] for savepoint release support in zope.sqlalchemy, I've been looking into how this might be done. Adding the necessary support to Zope's

[sqlalchemy] Re: Creating a Dialect for Amazon SimpleDB

2009-06-03 Thread Laurence Rowe
It would be interesting to see if this could be made to work. The SimpleDB model is rather different from the relational model, so it would only be useful if your application does not use any advanced features - no joins etc, each 'domain' might map to one big (albeit sparse) table. Laurence On

[sqlalchemy] Re: proposed extension to SessionExtension: after_bulk_operation

2008-11-05 Thread Laurence Rowe
On Nov 5, 9:14 am, Martijn Faassen [EMAIL PROTECTED] wrote: Michael Bayer wrote:   I wonder if a before_ hook should be provided as well. I don't know myself; Laurence, if you're listening in perhaps you'd care to comment? While there is aesthetic value to having symmetrical before and

[sqlalchemy] Re: multiprocessing best practices

2008-09-23 Thread Laurence Rowe
On Sep 23, 4:20 pm, mg [EMAIL PROTECTED] wrote: Hello There, I am developing an application that uses sqlalchemy and the py processing packages. My question is this, what is the best practice for using sessions in this type of app. Each subprocess needs to access my db to get work, so