Hi,

Here's an update on the problems I've been working on.

1) commit issue
Ticket #411 raised and the fix has been applied. I am working on a unit test; see below.

2) coinitialize
My current feeling is that this is an adodbapi bug, nothing to do with sa. I'll work with them in the first instance.

3) unicode fields
Ticket #298 had been created for this, but is not a complete solution. I have re-opened the ticker, with this comment:

Unicode columns are still created as VARCHAR. The problem is that Unicode is a TypeDecorator <http://www.sqlalchemy.org/trac/wiki/TypeDecorator> around a String type, and that TypeDecorator <http://www.sqlalchemy.org/trac/wiki/TypeDecorator>.dialect_impl gets the database type for the type that it wraps (i.e. String, not Unicode).

Fixing this could be interesting! One option is to make Unicode a completely separate type from String. This could raise issues for cross-database portability. MS-SQL has different database types for string and unicode fields. Postgres has a single string type, and it is a database option whether your strings are unicode.

It has been noted that NVARCHAR fields are UCS-2 only. Still, this is preferable to using VARCHAR with utf-8 encoding, as other applications (not using SQLAlchemy) may access the data. In any case, most Python builds are UCS-2 only.

4) session.flush() not getting primary keys
No update on this, but if it helps it appears when using ActiveMapper classes. No reflection is involved.

I have been working on a test for the commit problem. Basically we need a test that writes some data in one connection, commits, and then creates a new connection to check it can see the data. I had a go at this, but I will need some help getting this incorporated in the existing unit tests. As an aside, on my PC a number of unit tests fail for sqlite and loads fail for MSSQL. Over the coming months I will be using SA/MSSQL quite a lot so I will try to gradually get fixes in for the failing tests.


import sqlalchemy
from sqlalchemy import *
import os
import adodbapi

def getit():
return adodbapi.connect('Provider=SQLOLEDB;Data Source=.;User Id=pythonweb;Password=mdi*2mdO1;Initial Catalog=test')

db = create_engine("mssql:///paj", pool=sqlalchemy.pool.QueuePool(getit))
metadata = BoundMetaData(db)

users = Table('users', metadata,
 Column('user_id', Integer, primary_key=True),
 Column('user_name', String))
#users.create()

c1 = db.connect()
t1 = c1.begin()
c1.execute(users.insert(), user_id=1, user_name='user1') t1.commit()
c1.close()

#print len(c2.execute("select * from users").fetchall())

c2 = db.connect()
#t2 = c2.begin() print len(c2.execute("select * from users").fetchall())

Michael and Rick - thanks a lot for all your help on this.

Best wishes,

Paul

--~--~---------~--~----~------------~-------~--~----~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to