[sqlalchemy] Re: mysql innodb table insert problem

2008-07-11 Thread lilo
If I do manual insert into sql server like INSERT INTO lookup (username, shardname) VALUES ('0', 'shard1');, all works fine. But sqlalchemy doesn't insert for whatever reason into innodb table. Here is my shard session: create_session_lookup = sessionmaker(class_=ShardedSession,

[sqlalchemy] Re: mysql innodb table insert problem

2008-07-11 Thread lilo
Thanks, I got it to work now. But why did it work for myisam table in the first place. Shouldn't session scope problem also have affected the inserts for myisam table. Insert into myisam table worked because it does not support transactions? On Jul 11, 4:03 pm, Rick Morrison [EMAIL PROTECTED]

[sqlalchemy] mysql innodb table insert problem

2008-07-10 Thread lilo
I have set mysql tables to be innodb by default. Data inserted using sqlalchemy models never written to mysql innodb talbe. Innodb table is empty. If I try to insert data into the myisam tables, all the data get written to those tables. Here is the log of sqlalchemy insertion on innodb

[sqlalchemy] sqlalchemy connection pooling and mysql last_insert_id()

2008-07-10 Thread lilo
According my mysql, LAST_INSERT_ID() is connection specific, so there is no problem from race conditions. If I insert a record into a autoincremented table and do last_insert_id() on it, would there be a possibility where another insert happen just before selecting last_insert_id(). This won't

[sqlalchemy] Re: sharding id_chooser query_chooser

2008-07-03 Thread lilo
) ? And also not sure where and how you would associate lookup table, username and shardname mapping, into these functions. On Jun 27, 6:06 am, King Simon-NFHD78 [EMAIL PROTECTED] wrote: Lilo wrote: My understanding of this query_chooser is that it's used when you want to execute orm's sql

[sqlalchemy] Re: sharding id_chooser query_chooser

2008-06-26 Thread lilo
My understanding of this query_chooser is that it's used when you want to execute orm's sql rather than raw sql. I don't quite understand what is visit_binary function do from attribute_shard.py example. What does it mean binary.operator, binary.left, binary.right.clause and query._criterion?

[sqlalchemy] sharding id_chooser query_chooser

2008-06-25 Thread lilo
I am trying to understand what id_chooser and query_chooser do. Id_chooser basically uses a instance primary key to determine what shard the intance should be saved to? My primary keys(globally unique) are made of up more than one fields. Would that be a problem with Id_chooser? How/when would

[sqlalchemy] sharding database elixir metadata.drop_all and metadata.create_all problem

2008-06-19 Thread lilo
I have tried this command: a.a_metadata.drop_all(bind=db) a.a_metadata.create_all(bind=db) and they don't create any tables and I don't get any error at all. With, setup_all(True, bind=db), creates table A and B on each engine. I just want table A on m1,m2 and table B on n1,n2. I have