[sqlalchemy] Concurrency control using version_id_col

2007-06-21 Thread Sanjay
Hi, In order to achieve concurrency control using optimistic locking, we are doing the following: 1. Adding a column in the table like this: page_tbl = Table('page', metadata, Column('page_id', Integer, primary_key=True, autoincrement=True), Column('link_name', Unicode(30),

[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-21 Thread svilen
That is, in my case, lifetime of objects is much longer that lifetime of all database-and-related stuff - and seems this is not expected pattern of usage. more questions on the theme. What is the expected sequence / lifetime / pattern-of-usage for engine, metadata, mappers, and finally, my

[sqlalchemy] Re: Concurrency control using version_id_col

2007-06-21 Thread Michael Bayer
On Jun 21, 2007, at 4:50 AM, Sanjay wrote: Hi, In order to achieve concurrency control using optimistic locking, we are doing the following: 1. Adding a column in the table like this: page_tbl = Table('page', metadata, Column('page_id', Integer, primary_key=True,

[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-21 Thread Michael Bayer
On Jun 21, 2007, at 6:59 AM, svilen wrote: more questions on the theme. What is the expected sequence / lifetime / pattern-of-usage for engine, metadata, mappers, and finally, my objects? mappers need tables and therefore metadata, objects have mapped properties and therefore mappers. no

[sqlalchemy] Re: Unit Of work seems to be calling save/delete twice

2007-06-21 Thread Eric Ongerth
Thank you. Glad it worked out easily. --~--~-~--~~~---~--~~ 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 from this group, send email

[sqlalchemy] Re: session.clear() not clearing cascaded items?

2007-06-21 Thread sdobrev
thanks a lot, that cleared some mist. btw u can make a entry on the FAQ from this... e.g. lifetimes and usage patterns - or similar. The other rule inferred from above problem is b) objects lifetime should be shorter than mappers (ORM); else one needs to delete o._instance_key and

[sqlalchemy] new sqlalchemy-devel google group

2007-06-21 Thread Michael Bayer
Hi - those of you involved with the internal tinkerings of SQLAlchemy, please join over on the sqlalchemy-devel group, which is also at google groups: http://groups.google.com/group/sqlalchemy-devel - mike --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: help with IronPython

2007-06-21 Thread d_henderson
On Jun 20, 2:09 pm, Rick Morrison [EMAIL PROTECTED] wrote: The SA MSSQL module currently supports the three DBAPI modules mentioned above (pyodbc, pymssql, adodbapi). You'll need to either get one of those three to import under IronPython, or add support for the IPCE adaptor. pyodbc,

[sqlalchemy] lock tables in python way?

2007-06-21 Thread Can Xue
I'm using MySQL and when I need to lock a table, I do: conn = engine.connect() conn._autocommit = dummyFunc conn.execute(LOCK TABLES tablename WRITE) try: ... conn.execute(COMMIT) except: conn.execute(ROLLBACK) ... finally:

[sqlalchemy] Re: lock tables in python way?

2007-06-21 Thread Michael Bayer
conn = engine.connect() trans = conn.begin() ...etc trans.commit() table locking is usually either implicit to SQL operations performed within the transaction or using a construct like SELECT..FOR UPDATE, but you can still issue your straight text if you like (but LOCK TABLES isnt portable).