Re: [sqlalchemy] How to insert a new row into a Sybase database table which has an IDENTITY primary key column?

2012-05-09 Thread Anthony Kong
Hi, Micheal, Thanks for the reply. I have added autoincrement to the Column definition of 'id', like so: id = Column(Integer, name='id_trade', primary_key=True, autoincrement=True) In the log I can see the id column is not included in the INSERT statement. I have taken that SQL statement

[sqlalchemy] Mapper compilation errors in multi threaded web application using dynamic mapping to selects

2012-05-09 Thread Jochen Stenzel
Hello, is there a problem in mapping classes to selects ([1]) /within a function/? We are running into mapper errors reading InvalidRequestError: One or more mappers failed to compile. Exception was probably suppressed within a hasattr() call. Message was: One or more mappers failed to

Re: [sqlalchemy] How to insert a new row into a Sybase database table which has an IDENTITY primary key column?

2012-05-09 Thread Michael Bayer
On May 9, 2012, at 4:46 PM, Anthony Kong wrote: Hi, Micheal, Thanks for the reply. I have added autoincrement to the Column definition of 'id', like so: id = Column(Integer, name='id_trade', primary_key=True, autoincrement=True) that's fine, but the table has to be created that way

Re: [sqlalchemy] Mapper compilation errors in multi threaded web application using dynamic mapping to selects

2012-05-09 Thread Michael Bayer
On May 9, 2012, at 8:10 PM, Jochen Stenzel wrote: Hello, is there a problem in mapping classes to selects ([1]) /within a function/? with multiple threads, where the mappers initialization may first proceed as the product of a thread running, yes. you'd want to upgrade to 0.7 for the

Re: [sqlalchemy] Mapper compilation errors in multi threaded web application using dynamic mapping to selects

2012-05-09 Thread Claudio Freire
On Wed, May 9, 2012 at 4:11 PM, Michael Bayer mike...@zzzcomputing.com wrote: Hello, is there a problem in mapping classes to selects ([1]) /within a function/? with multiple threads, where the mappers initialization may first proceed as the product of a thread running, yes.     you'd want

Re: [sqlalchemy] How to insert a new row into a Sybase database table which has an IDENTITY primary key column?

2012-05-09 Thread Anthony Kong
1) Yes, I am working with existing table 2) The id column is not included in the SQL, which is the expected behaviour if we want the server to generate value for the IDENTITY column in sybase/ms-sql 3) ok Any tracing option I can use to see how SQLA deals with the 'id' column? On

Re: [sqlalchemy] How to insert a new row into a Sybase database table which has an IDENTITY primary key column?

2012-05-09 Thread Anthony Kong
I think I have found the root cause of the problem. I am using a sybase database server of version 15 (Adaptive Server Enterprise/15.0.3/EBF 17163) But for various reasons we are still using sybase ODBC driver 12.5. If I switch to 15.5, it just works as expected. *A follow-up