Re: [Sqlalchemy-users] (two other ways to totally disable) "caching"

2006-03-26 Thread Michael Bayer
Oh, i would never recommend turning off the identity mapthe second patch below is more for educational means, which is why I say its "definitely worth trying" - I was amazed at how fast things started to break down when i tried it.    having the mapper re-fetch the attributes on every select is

Re: [Sqlalchemy-users] Class Inheritance / Polymorphism

2006-03-26 Thread Michael Carter
Well, I have a temporary fix for my project, and it is pretty similar to the last. I changed the object_mapper function from mapper.py to be this: def object_mapper(object):     """given an object, returns the primary Mapper associated with the object     or the object's class."""     if hasattr(o

Re: [Sqlalchemy-users] (two other ways to totally disable) "caching"

2006-03-26 Thread Jonathan Ellis
I'm really suspicious of this because the other ORM whose design I really admire, the Java SimpleORM, also has an identity map with no way to turn it off, and its author has put a hell of a lot of thought into it.  FWIW. On 3/26/06, Michael Bayer <[EMAIL PROTECTED]> wrote: this patch will cause the

Re: [Sqlalchemy-users] caching

2006-03-26 Thread Jonathan Ellis
On 3/26/06, Florian Boesch <[EMAIL PROTECTED]> wrote: So how do you scale/split your application across multiple data accessingservers (short of writing an application server)?What problems does an identity map pose to multiple client processes? I'm confused because you seem to imply that if you co

Re: [Sqlalchemy-users] Re: Retrofitting database back end

2006-03-26 Thread Jonathan Ellis
On 3/26/06, Jonathan Hayward http://JonathansCorner.com <[EMAIL PROTECTED] > wrote: 2: What is the best way to store a list of strings as a field in adatabase? (If need be I can have a delimiter-separated string, but Iwant to know if there is a better method.) You need a one-to-many join. So you'

[Sqlalchemy-users] 0.1.5 released

2006-03-26 Thread Michael Bayer
I am pleased to announce release 0.1.5 ! thanks to everyone who has helped patch, identify, suggest, illustrate, and that includes everyone on this list. changelog: 0.1.5 - added SQLSession concept to SQLEngine. this object keeps track of retrieving a connection from the connection pool a

Re: [Sqlalchemy-users] Class Inheritance / Polymorphism

2006-03-26 Thread Michael Bayer
hey michael -I committed another small thing to mapper to help some more with this.  with a regular mapper->mapper inheritance, the submapper can specify the same table as the parent.  I worked up many-to-many relationships on both Test and Test1 (to test that you can stick them on the child object

Re: [Sqlalchemy-users] hibernate

2006-03-26 Thread Jonathan Ellis
On 3/26/06, Florian Boesch <[EMAIL PROTECTED]> wrote: And yes, I'm also *SICK* of putting up with an endless stream of bugs that keepcreeping up and slowing me down."I demand you make this alpha software production-quality immediately!" Grow up, dude.May I suggest digging into the code and fixing t

Re: [Sqlalchemy-users] Class Inheritance / Polymorphism

2006-03-26 Thread Michael Carter
It seems that this problem is giving me more trouble than I originally thought. If I create a many-to-many relation between the baseclass Test and some other class Foo to get the attribute foos, then it doesn't work with Test1 and Test2 instances. a = Test1(); a.foos.append(Foo()); objectstore.comm

Re: [Sqlalchemy-users] hibernate

2006-03-26 Thread Michael Bayer
and anyway, SVN changeset 1216 : m = mapper(class, table, always_refresh=True) anytime that mapper pulls an already-loaded object from the identity map when traversing a rowset, it will overwrite the object's properties with the rowset's data. will blow away any changes on that ob

Re: [Sqlalchemy-users] hibernate

2006-03-26 Thread Michael Bayer
On Mar 26, 2006, at 5:56 PM, Florian Boesch wrote: And yes, I'm also *SICK* of putting up with an endless stream of bugs that keep creeping up and slowing me down. SA was only released as an SVN checkout in November. its going to have a lot of bugs for many months. not like ive been wor

Re: [Sqlalchemy-users] hibernate

2006-03-26 Thread Michael Bayer
units of work are by definition localized to a particular in-process thread-local session. there is no magical "machine-spanning" unit of work going on. if you are looking for some kind of "global database" where all data is always exactly fresh to all processes everywhere, that would ha

Re: [Sqlalchemy-users] hibernate

2006-03-26 Thread Florian Boesch
And yes, I'm also *SICK* of putting up with an endless stream of bugs that keep creeping up and slowing me down. I'm empathic, don't get me wrong, and hurray, the last two svn updates I did didn't break my whole application and mostly still have all issues I report and produced test programms for

[Sqlalchemy-users] hibernate

2006-03-26 Thread Florian Boesch
As we're down to mutual shouting, Yes Michael, hibernate may be hugely popular, and I may not know it, but from what I hear hibernate scales across a cluster of machines... How does SA scale across a cluster of machines? I don't see how this works with SA. I'd be happy if you enlighten my ways b

Re: [Sqlalchemy-users] (two other ways to totally disable) "caching"

2006-03-26 Thread Michael Bayer
this patch will cause the mapper to reload all the properties in identity-mapped objects every time a SELECT statement comes across it, blowing away any changes that might have been made to the object in memory. it maintains the unique per-session identity map of instances: Index: lib/

Re: [Sqlalchemy-users] firebird connection - does autoload work?

2006-03-26 Thread Michael Bayer
firebird doesnt work at all right now AFAIK...if it actually did some things correctly, thats great news. the creator/maintainer of the module has been on vacation until this week, and has not yet gotten around to the initial testing of the module which I committed into SVN for him a few

[Sqlalchemy-users] firebird connection - does autoload work?

2006-03-26 Thread Brad Clements
I am using 3.2 Kinterbasdb with latest svn sqlalchemy. I've defined tables using autoload, but primary_key = False in all the tables loaded. Also it doesn't seem to create foreign keys either. Anyone know if this is supposed to work with firebird? -- Brad Clements,[EMAIL P

Re: [Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Koen Bok
Ha! objectstore.commit() was where I all did it for! I will stick to the plan figuring how PyObjC decides what a list is. Then I will someway let it decide the mapper results are also lists. Thanks for your quick replies! Koen On 26-mrt-2006, at 23:02, Michael Bayer wrote: On Mar 26, 200

Re: [Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Michael Bayer
On Mar 26, 2006, at 3:48 PM, Koen Bok wrote: Does indeed work, but orders[1].products is still an object. Is there a way to convert all of the relation results to lists? not really, since a plain list cannot track changes you have made to that list, and a plain list also does not enfo

Re: [Sqlalchemy-users] caching

2006-03-26 Thread Florian Boesch
So how do you scale/split your application across multiple data accessing servers (short of writing an application server)? Calling objectstore.clear() everywhere? Quoting Michael Bayer <[EMAIL PROTECTED]>: > theres no caching in SQLAlchemy. theres an identity map which has > some of the same e

Re: [Sqlalchemy-users] SQLObject and SQLAlchemy

2006-03-26 Thread Michael Bayer
well there are already two projects in this vein: http://cleverdevil.org/computing/35/declarative-mapping-with-sqlalchemy http://trac.pocoo.org/wiki/DatabaseApi On Mar 26, 2006, at 2:57 PM, David Geller wrote: I realize that this is up to Ian, and I know he has some problems with certain as

Re: [Sqlalchemy-users] cascade_mapper does not support multiple joins

2006-03-26 Thread Gambit
I put into the wiki's recipe section a working version of all this, for those who are interested. Incidentally -- I know the join's ambiguous, but while we're guessing with cascade_mapper (that is, if it's going to be used as a feature), we might as well guess intelligently. Does the current

Re: [Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Michael Bayer
well other folks have been asking that it return a generator object which dynamically executes the query at the moment you ask for a slice of it.you can always go with orders = list(Order.mapper.select(limit=3)) to assure the type.any particular reason "list" is so important ?  whats python without

Re: [Sqlalchemy-users] caching

2006-03-26 Thread Michael Bayer
theres no caching in SQLAlchemy. theres an identity map which has some of the same effects as a cache. basically, if you have already loaded your object into the current session, thats it. if you load it again, its going to use the same one you have, unless you clear the session, or refr

Re: [Sqlalchemy-users] cascade_mapper does not support multiple joins

2006-03-26 Thread Michael Bayer
im not a huge fan of cascade_mapper for reasons like this. since you have an ambiguous join, perhaps youre looking for explicit join conditions ? http://www.sqlalchemy.org/docs/ adv_datamapping.myt#adv_datamapping_relations_customjoin On Mar 26, 2006, at 1:05 PM, Gambit wrote: Hi guys -

Re: [Sqlalchemy-users] SQLObject and SQLAlchemy

2006-03-26 Thread David Geller
I realize that this is up to Ian, and I know he has some problems with certain aspects of SA architecture, but doesn't it make sense for there to be a "SO compatibility layer" to SA, rather then continuing a completely separate SO? This, since it seems SO performs a subset of what SA is capabl

[Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Koen Bok
When I make a selection with a mapper I get back an object. Same goes for the mapper's relations.Is there any way to make SQLAlchemy returning standard objects?Example:orders = list()print type(orders) #orders = Order.mapper.select(limit=3)print type(orders)print orders[, , ] # Looks like a list,

Re: [Sqlalchemy-users] Re: Retrofitting database back end

2006-03-26 Thread Jonathan Hayward http://JonathansCorner.com
On 3/26/06, Jonathan Ellis <[EMAIL PROTECTED]> wrote: On 3/25/06, Jonathan Hayward http://JonathansCorner.com <[EMAIL PROTECTED] > wrote: A few questions:1: How do I specify a string of indeterminate length in the pseudocode at the bottom of this list? It will be a usability bug if I setarbitrary

[Sqlalchemy-users] caching

2006-03-26 Thread Florian Boesch
Seemingly SA is fairly liberal with interpreting my wish to get stuff from the database. So what's the pattern to deal with "session" "caching"? I hear there's expunge etc. now, and expire, but that's all when I know what objects I want to have removed/expired/refreshed. Fact is, I don't, I would

[Sqlalchemy-users] cascade_mapper does not support multiple joins

2006-03-26 Thread Gambit
Hi guys - I'm not sure this is a bug or not, but if not it might be worth adding a comment to the documentation. Using the following schema: table A: pk B_fk_1 B_fk_2 ... table B: pk info After setting up A and B correctly (see attachment), and

Re: [Sqlalchemy-users] Re: Retrofitting database back end

2006-03-26 Thread Jonathan Ellis
On 3/25/06, Jonathan Hayward http://JonathansCorner.com <[EMAIL PROTECTED] > wrote:A few questions:1: How do I specify a string of indeterminate length in the pseudocode at the bottom of this list? It will be a usability bug if I setarbitrary limits on how long things can be?Just don't specify a le

Re: [Sqlalchemy-users] Class Inheritance / Polymorphism

2006-03-26 Thread Michael Carter
Great, I'll check out the latest revision. There was another issue that I ran into a couple hours ago. That is, if you turn database echo on for the test2 example you can see that every time you make a call like Test.get(1) or Test.get(2) the object is reloaded from the database. I believe that th