Re: [sqlalchemy] 0.6 and c extensions

2010-03-21 Thread Antoine Pitrou
Le dimanche 21 mars 2010 à 02:10 -0700, drakkan a écrit : Hi, a really interesting feature in sa 0.6 are the c extensions, however I think they should be implemented using ctypes so if python ctypes extension is available (default in python =2.5 and available even for 2.4) the c extensions

Re: [sqlalchemy] assert_unicode=True

2010-02-25 Thread Antoine Pitrou
Le Thu, 25 Feb 2010 21:44:51 +0100, Marcin Krol mrk...@gmail.com a écrit : SAWarning: Unicode type received non-unicode bind param value 'Jane Shmoe' param[key.encode(encoding)] = processors[key](compiled_params[key]) [...] I would need this to be error rather than warning just like docs

Re: [sqlalchemy] Re: joining sessions / two phase commit

2010-02-14 Thread Antoine Pitrou
Le dimanche 14 février 2010 à 17:47 +, Chris Withers a écrit : Wichert Akkerman wrote: On 2010-2-9 09:48, Chris Withers wrote: I know that zope's transaction package aims to do just this, I wonder if anyone's used that, or anything else, with SA to solve this problem? You mean

Re: [sqlalchemy] Re: joining sessions / two phase commit

2010-02-14 Thread Antoine Pitrou
Le dimanche 14 février 2010 à 19:45 +0100, Wichert Akkerman a écrit : That is by design: zope.sqlalchemy (which is really the thing you are complaining about) forces you to commit the entire transaction. This is required to coordinate transactions between multiple participants in a

Re: [sqlalchemy] Re: joining sessions / two phase commit

2010-02-14 Thread Antoine Pitrou
Le dimanche 14 février 2010 à 19:58 +0100, Wichert Akkerman a écrit : On 2/14/10 19:54 , Antoine Pitrou wrote: Le dimanche 14 février 2010 à 19:45 +0100, Wichert Akkerman a écrit : That is by design: zope.sqlalchemy (which is really the thing you are complaining about) forces you

Re: [sqlalchemy] session commit and the GIL

2010-02-02 Thread Antoine Pitrou
Le mardi 02 février 2010 à 01:08 -0800, Eyal Gordon a écrit : Hello, I'm running sqlalchemy on python 2.4.3, with postgresql. My application is multi-threaded, commits and queries are protected by a python thread lock. I suspect that when running session.commit(), the python global

Re: [sqlalchemy] any way to pre cook a monster query?

2010-01-27 Thread Antoine Pitrou
Le mercredi 27 janvier 2010 à 12:31 -0500, Michael Bayer a écrit : Or, we can generate the compiled() object, which contains the SQL string as well as a lot of important metadata about the statement used when fetching results. But this is not possible without access to a dialect and

Re: [sqlalchemy] Table as dictionary?

2010-01-15 Thread Antoine Pitrou
Le vendredi 15 janvier 2010 à 09:28 -0800, Nelson a écrit : Hello SQLAlchemy experts, I'd like to view the contents of a table object as a dictionary. Example: s = Table('sparrow', Column('type', String(50)) , Column('weight', Integer), ... etc) s.type = 'African' s.weight = 32 Then

Re: [sqlalchemy] pylons SQLAlchemy memory

2010-01-11 Thread Antoine Pitrou
Le lundi 11 janvier 2010 à 15:55 -0800, diana a écrit : And now for a question about a completely different app (no sharding, very simple). I haven't got a sufficient response from the pylons group, so I'm trying here. The question:

Re: [sqlalchemy] Sqlalchemy and python 3

2010-01-05 Thread Antoine Pitrou
Le mardi 05 janvier 2010 à 11:32 -0500, Michael Bayer a écrit : its likely a line which needs a PY3K/PY2K directive. Or simply replace it with `NoneType = type(None)`. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

Re: [sqlalchemy] Re: Sqlalchemy and python 3

2010-01-05 Thread Antoine Pitrou
The line that tries to import NoneType from the types module. I can't tell you which one exactly, I have never read the code, but it should be trivial :-) Le mardi 05 janvier 2010 à 10:07 -0800, batok a écrit : Replace what line? In properties.py ? On Jan 5, 10:42 am, Antoine Pitrou solip

Re: [sqlalchemy] Python Pickle Error - Can't pickle class 'sqlalchemy.orm.session.Session'

2009-12-18 Thread Antoine Pitrou
Does anyone have any idea how I can get around this Pickling error? Different ways to make your class picklable are described here: http://docs.python.org/library/pickle.html#pickling-and-unpickling-normal-class-instances You could for example write __getstate__ and __setstate__ methods such

Re: [sqlalchemy] base classes that have nothing to do with table inheritence

2009-12-17 Thread Antoine Pitrou
Le jeudi 17 décembre 2009 à 11:05 -0500, Michael Bayer a écrit : Chris Withers wrote: How should I create a class like this? This isn't about table inheritance or the like and I'm *sure* I was told an easy solution for this specific use case before, but I can't find it for the life of me

[sqlalchemy] Re: performance issues

2009-12-16 Thread Antoine Pitrou
Hello, just in case you're not motivated to share mappings here, I would note that an incorrect placement of a flag like remote_side on a relation() may be causing this. I would have to produce anonymized mappings, but I will do so if it's useful. What do you mean by incorrect placement of a

Re: [sqlalchemy] Re: performance issues

2009-12-16 Thread Antoine Pitrou
I would have to produce anonymized mappings, but I will do so if it's What do you mean by incorrect placement of a flag like `remote_side`? I do have one (exactly one) relation with a `remote_side` flag, but the class it is defined on isn't involved in the script I have timed here. (it

[sqlalchemy] performance issues

2009-12-15 Thread Antoine Pitrou
Hello, I've got some scripts which take quite a bit of time and I wanted to investigate why they were so long. So I profiled them using cProfile and I was quite surprised to get the following results. In short, SQL queries themselves take less than 10% of the total time, and most of the time is

[sqlalchemy] The transaction is inactive due to a rollback in a subtransaction

2009-07-12 Thread Antoine Pitrou
Hi, I'm getting the following error in one of my unit tests, while I have never opened a subtransaction. The only thing that happens in that test is that a first db_session.flush() raises an IntegrityError (this is deliberate, because I test the generation of an unique number). Then a second

[sqlalchemy] Re: The transaction is inactive due to a rollback in a subtransaction

2009-07-12 Thread Antoine Pitrou
On 12 juil, 23:37, Michael Bayer mike...@zzzcomputing.com wrote: the session always does things in a transaction , as does any DBAPI   connection running in the default mode of operation as according to   spec.    Whether or not the Session leaves the transaction open after   an individual

[sqlalchemy] Re: The transaction is inactive due to a rollback in a subtransaction

2009-07-12 Thread Antoine Pitrou
Hello, Thanks for the lengthy (!) explanation. On Jul 13, 1:05 am, Michael Bayer mike...@zzzcomputing.com wrote: Postgres in   particular has operations which, once failed, the transaction is not   allowed to continue: Ouch. I'll have to change my strategy, then (I run unit tests with

[sqlalchemy] Re: The transaction is inactive due to a rollback in a subtransaction

2009-07-12 Thread Antoine Pitrou
On Jul 13, 1:33 am, Michael Bayer mike...@zzzcomputing.com wrote: pysqlite doesn't seem to support SAVEPOINT out of the box.  Jason   Kirtland found out a little bit about it here:   http://itsystementwicklung.de/pipermail/list-pysqlite/2009-June/00041...   .   But I'm not sure how that can