Re: [sqlalchemy] How do you handle threading issues?

2009-12-18 Thread Michael Bayer
On Dec 18, 2009, at 8:45 PM, Kevin Ar18 wrote: > it really is that - simultaneous transactions are isolated from one another, > and their results are only made visible to other transactions after they're > committed. as far as locking, you generally choose between an "optimistic" > and a "pe

[sqlalchemy] Re: Detaching Relation Objects for Purpose of Serialization

2009-12-18 Thread zende
nevermind :( poet.__dict__.pop('poems') -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For

RE: [sqlalchemy] How do you handle threading issues?

2009-12-18 Thread Kevin Ar18
it really is that - simultaneous transactions are isolated from one another, and their results are only made visible to other transactions after they're committed. as far as locking, you generally choose between an "optimistic" and a "pessimistic" approach: Thanks. Ok, so I found an article

[sqlalchemy] Detaching Relation Objects for Purpose of Serialization

2009-12-18 Thread zende
How do I detach or unload the data from a relation on an instance? I'm writing a thin layer on top of SA for caching and need to do serialization. The following happens when serializing: poet = session.query(Poet).find_by(name='Haafez').one() pickle.dumps(poet) # Only serializes the Poet object

[sqlalchemy] Re: Cache Invalidation. Alternatives to MapperExtension?

2009-12-18 Thread zende
@michael: changed to after_commit @ivan: Sorry for the late reply. Here's a decent example. I have this working in production error free, but it's hardly done. Note, the code below is a specific example. Let me know if you have questions from sqlalchemy import orm def get_session_id(session)

Re: [sqlalchemy] Off Topic: Declarative-style for XML?

2009-12-18 Thread Wichert Akkerman
On 2009-12-18 20:50, AF wrote: > Hello, > > I've become quite used to SQLAlchemy's Declarative style notation for > defining data to be stored in SQL. > > Does anyone know of library that will do something similar for simple > XML? > > Basically I need objects (and attributed collections of objects

[sqlalchemy] Off Topic: Declarative-style for XML?

2009-12-18 Thread AF
Hello, I've become quite used to SQLAlchemy's Declarative style notation for defining data to be stored in SQL. Does anyone know of library that will do something similar for simple XML? Basically I need objects (and attributed collections of objects) that are effectively records for groups of s

[sqlalchemy] Re: Python Pickle Error - "Can't pickle "

2009-12-18 Thread Lynton Grice
Thanks a lot for the suggestions, I will give it a much closer look now... Lynton On Dec 18, 7:19 pm, "Michael Bayer" wrote: > Lynton Grice wrote: > > Hi there, > > > I am writing a little persistant Queue class/s using sqlalchemy and > > sqlite. All is going fine with the development but now I

Re: [sqlalchemy] Python Pickle Error - "Can't pickle "

2009-12-18 Thread Michael Bayer
Lynton Grice wrote: > Hi there, > > I am writing a little persistant Queue class/s using sqlalchemy and > sqlite. All is going fine with the development but now I have reached > the stage where I would like to have each request spawned as a new > process (from Python's muliprocessing module). The

Re: [sqlalchemy] Python Pickle Error - "Can't pickle "

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 t

[sqlalchemy] Python Pickle Error - "Can't pickle "

2009-12-18 Thread Lynton Grice
Hi there, I am writing a little persistant Queue class/s using sqlalchemy and sqlite. All is going fine with the development but now I have reached the stage where I would like to have each request spawned as a new process (from Python's muliprocessing module). The error I am getting is: "Can't p

Re: [sqlalchemy] psycopg2

2009-12-18 Thread Julien Cigar
resolved... it was a bug in psycopg2. Julien Cigar wrote: > Dear SQLAlchemists, > > I have a small problem with psycopg2, nothing do to with SQLAlchemy > but.. I didn't find any other appropriate mailing list.. > > The problem is that I can't access columns by key with DictCursor() as > cursor

[sqlalchemy] psycopg2

2009-12-18 Thread Julien Cigar
Dear SQLAlchemists, I have a small problem with psycopg2, nothing do to with SQLAlchemy but.. I didn't find any other appropriate mailing list.. The problem is that I can't access columns by key with DictCursor() as cursor_factory and server side cursors .. Here is a concrete example : http://

[sqlalchemy] Re: Sybase T-SQL join Dialect

2009-12-18 Thread Shuaib Osman
> its true, the dialect was never written for ASE.   It also hasn't been used > by anyone I'm aware of since the original author submitted it against version > 0.3 of SQLA.  I'm surprised its usable at all at this point. > > If you'd like to help us with a real Sybase dialect, it would be targete