4 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: time to remove creat...
FromSent OnAttachments
Jonathan Ellis27 Jun 2008 16:42 
Michael Bayer27 Jun 2008 16:53 
Martijn Faassen27 Jun 2008 18:10 
Michael Bayer27 Jun 2008 22:12 
Subject:[sqlalchemy] Re: time to remove create_session?
From:Martijn Faassen (faas@startifact.com)
Date:06/27/2008 06:10:30 PM
List:com.googlegroups.sqlalchemy

Michael Bayer wrote:

two things are needed:

1. the "official" way to create a Session when all you want is a Session, with no custom builder class or anything like that. It should not be grossly inconsistent with the default arguments of the current sessionmaker() call.

2. all the myriad "create_session()" calls in the unit tests need to call something that acts like the old "create_session()", i.e. with all the newfangled things turned off by default.

My vote would be for 1. just call Session(), and 2. we just put a "create_session()" function in the testlib.

So creating the Session class directly is the right way to go? I switched from using that to create_session when I found out about the existence of this function, but I can switch back.

Note that I really need to create sessions themselves; I cannot use sessionmaker nor scoped_session, as I have a special scoped session that needs to be able to create sessions.

Regards,

Martijn