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
1
  • Will you please provide some code which create the error. Because isolation_level is not available for all database. Commented Feb 29, 2012 at 5:00

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

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)

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.