1

How to set isolation level in sqlalchemy pool configuration. I get the following error when i try to set it as paramaeter in create_engine(...)

File "build/bdist.linux-i686/egg/sqlalchemy/engine/__init__.py", line 321, in create_engine
File "build/bdist.linux-i686/egg/sqlalchemy/engine/strategies.py", line 141, in create
TypeError: Invalid argument(s) 'isolation_level' sent to create_engine(), using configuration  
MySQLDialect_mysqldb/QueuePool/Engine
Nilesh
  • 20,521
  • 16
  • 92
  • 148
Ashish
  • 851
  • 12
  • 27
  • Will you please provide some code which create the error. Because `isolation_level` is not available for all database. – Nilesh Feb 29 '12 at 05:00

3 Answers3

1

Like explained in this answer, you can achieve the same result by directly issuing the SQL command to set the isolation level. In case of SQL Server, you could do:

query = 'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'
session.connection().connection.execute(query)
Community
  • 1
  • 1
Mahdi
  • 1,778
  • 1
  • 21
  • 35
1

Which version of sqlalchemy do you have because this functionality for mysql is added in 0.7.6.

Nilesh
  • 20,521
  • 16
  • 92
  • 148
0

'isolation_level' parameter is passed as one of the argument to create_engine method

Michael Bayer replied on the SQLAlchemy forum : it's the development version. for the moment you can get it like this: hg.sqlalchemy.org/sqlalchemy/archive/default.tar.gz

This solves the problem.

Ashish
  • 851
  • 12
  • 27