sqlobject performance problems (really)
qvx
qvx3000 at gmail.com
Wed Sep 28 02:49:46 EDT 2005
qvx wrote:
> "autocommit off" attempt:
>
> connection_string = 'sqlite:/' + db_filename +'?autoCommit=0'
>
> "no select" attempt:
>
> t1 = T1(id=t1id, col1=r.col1, ...)
I changed :
conn_string = 'sqlite:/' + db_datoteka +'?autoCommit=0'
conn = connectionForURI(conn_string)
SQLObject._connection = conn
into:
conn_string = 'sqlite:/' + db_datoteka +'?autoCommit=0'
conn = connectionForURI(conn_string)
conn.autoCommit = False
tran = conn.transaction()
sqlhub.threadConnection = tran
This seems to help in performance department. But it now fails with
exception:
* when input is unicode
for ex: t1.col1 = unicode(col1, encoding='dbcs')
=> UnicodeEncodeError: 'ascii' codec can't encode character
u'\u0107' ...
File "sqlobject\col.py", line 498, in from_python
return value.encode("ascii")
* when input is 'utf8'
for ex: t1.col1 = unicode(col1, encoding='dbcs').encode('utf8')
=> UnicodeEncodeError: 'ascii' codec can't encode character
u'\u017d' ...
File "sqlobject\col.py", line 489, in to_python
return value.encode("ascii")
* when input is 'dbcs'
for ex: t1.col1 = col1_var # col1_var it is already in 'dbcs'
=> UnicodeDecodeError: 'utf8' codec can't decode bytes ...
File "sqlobject\dbconnection.py", line 295, in _executeRetry
return cursor.execute(query)
P.S. I'm a Windows Central European (windows-1250) user and my
sys.setdefaultencoding is 'dbcs'.
More information about the Python-list
mailing list