[sqlalchemy] Re: SQLAlchemy 0.5.5 MySQL Issue

2009-11-29 Thread gizli
and may make all flushes persistent. The other storage engine widely used is InnoDB which does support transactions. Find out in the MySQL docs how to figure out which storage engine you're using. Sent from my fantastic HTC Hero On Nov 28, 2009 7:27 AM, gizli mehm...@gmail.com wrote: I am

[sqlalchemy] Re: SQLAlchemy 0.5.5 MySQL Issue

2009-11-27 Thread gizli
gizli mehm...@gmail.com: With mysql however, the insert done by the query() actually does a commit.. i turned on echo, and i dont see an explicit commit but this is what seems to happen.. After the program is done, I can see Obj(5) in the mysql database. Is this a known problem? Or am I

[sqlalchemy] Concurrent Update Errors

2009-09-17 Thread gizli
Hi guys, I have a couple of questions about a recent concurrency test I did on SA. Someone in our team ran into a very intermittent issue where a certain operation he tried doing failed by ConcurrentUpdateError. I wrote a simple thread that can do query/update/insert/commit/rollback operations

[sqlalchemy] Re: Concurrent Update Errors

2009-09-17 Thread gizli
provided a way to turn the feature off. Thanks a lot. On Sep 17, 3:59 pm, Michael Bayer mike...@zzzcomputing.com wrote: gizli wrote: t1.delete(obj) t2.delete(obj) t2.commit() t1.commit() I also forgot to mention that you can always use query.delete() or table.delete() to get a standard

[sqlalchemy] Setting language for a db session

2009-09-14 Thread gizli
Hi all, I am just starting to think about this topic so please dont shoot me if I missed the obvious :). There are many varieties of database errors. So, sometimes in our code, we need to let these errors be returned to the user. E.g. we would like a french guy using this application to have a

[sqlalchemy] Re: Automatic Polymorphic Identity Assignment

2009-09-10 Thread gizli
decorators.. write a function similar to the polymorphicsetter class above and return the modified cls object.. then for every subclass of Task, use the decorator.. The advantage of the first approach is that, there is no need to do anything once the Task class is extended.. On Sep 9, 7:51 pm, gizli

[sqlalchemy] Automatic Polymorphic Identity Assignment

2009-09-09 Thread gizli
Hi all, This list has been very helpful so far, thanks a lot. I was just wondering if there is a transparent way to assign polymorphic identities to ORM classes using single table inheritance. Let's say we have a base Task class: class Task(DeclarativeBase): __tablename__ = 'Tasks' id =

[sqlalchemy] Re: Automatic Polymorphic Identity Assignment

2009-09-09 Thread gizli
Thanks for the suggestion Wolodja but I dont think that would work. The self object is not defined at the time of class loading in python: class Test: ... qq = self.__class__.__name__ ... def fu(self): ... print fu ... Traceback (most recent call last): File stdin, line 1,

[sqlalchemy] Curious Problem

2009-09-01 Thread gizli
Hi all, I just discovered something weird when doing concurrency testing with my program. Before writing a simplified test case for it and really figuring out whether its a bug with sqlalchemy (I am using 0.5.5), I wanted to write the scenario here. Basically I was getting the infamous Set size

[sqlalchemy] Autoflush setting

2009-08-28 Thread gizli
Hi all, I have a pretty basic question about autoflush that I could not find an answer to. By default, in sessionmaker, this is set to true. However, I have this basic scenario where my transaction involves inserting objects into session and querying for some others: add(o1) query(SomeObject)

[sqlalchemy] Re: Autoflush setting

2009-08-28 Thread gizli
Okay. I believe this is my mistake. I just wrote a simple test program and saw that the other threads should not see o1 or o2 until commit since I am using scoped_session. I guess there is another reason for the behavior I am seeing. On Aug 28, 10:05 pm, gizli mehm...@gmail.com wrote: Hi all

[sqlalchemy] Performance Analysis

2009-08-15 Thread gizli
Hi all, This is not really a sqlalchemy question but I was wondering if anyone developing with sqlalchemy knows the answer. Turning on echo=True spits out all the queries that the application generates. Currently I am directing this output to a file and then looking through to derive statistics

[sqlalchemy] Re: Many-to-many relations

2009-08-12 Thread gizli
Never mind. Using primaryjoin and secondaryjoin helped quite a bit :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe

[sqlalchemy] Many-to-many relations

2009-08-10 Thread gizli
Hi all, Please help me model this scenario with many-to-many relations: I am trying to model a directed graph. My objects are nodes: n1...nk, and I have a bunch of directed edges: n1 -- n3, n5 -- n6, n6 -- n2 and so on. From reading the documentation, I know that the nodes will probably be one

[sqlalchemy] Re: Reentrant data population script using sql alchemy

2009-08-10 Thread gizli
Thanks a lot Michael. The merge functionality is what I was looking for. This also exposed a flaw in our model I think. We keep using the auto-increment primary keys which would make merge() impossible to use in the scenario I was describing. Right? The easiest way to do auto insert or

[sqlalchemy] Reentrant data population script using sql alchemy

2009-08-09 Thread gizli
Hi all, Forgive me if this is a very basic question but I could not find the answer anywhere. I am trying to write a data population script to setup a few tables and insert some data in them. I need to make this script reentrant.. The problem is that currently the script looks like this: get a