On May 11, 2006, at 12:03 AM, Daniel Miller wrote:

The thread-local mod is implied in all the documentation examples for 0.2; therefore it will be used by most if not all SA users at least at first. When a project starts to move from simple experimentation mode into a full-blown complex project where resource management must be flexible and configurable this will become a thorn.

I disagree that threadlocal behavior is only useful for "simple experimentation mode", and i dont think its a good idea to say, "lets not include this feature, because if people use it, then they will eventually have to not use it and that will be too hard for them to change their code"; theres two assumptions in there which are not necessarily true. the philosophy of refactoring is that things start simple and get refactored to have more configurability and complexity.

the entire SA 0.2 docs with the exception of the tutorial does *not* use the threadlocal mod in its examples, i spent many hours rewriting all of them to use the Session/Query style which was primarily your idea (and hibernate's). however, the tutorial will be where people start, and in fact by just removing the "threadlocal" mod the tutorial actually gets simpler in this case. this is a product of the fact that threadlocal behavior is disabled by default, so now its automatically more difficult to put in a basic tutorial since its another concept that must be explained.

so as of now, the "current_session" call in the tutorial has been replaced with "create_session", and two session.save() methods have been added where new objects were constructed. the "threadlocal" mod has been removed from the tutorial as well as all mention of it. when I originally wrote SA, i was very concerned about people having to explicitly associate their new instances with a session, that people would find it unnecessarily complicated; this was the primary reason that gave rise to the thread-local logic. but now that we have some momentum, lets see how requiring some save() methods with new instances, unless you want to go learn about threadlocal stuff, flies.

so, if we agree on how implicit thread local ability, as deemphasized and probably never-will-be-used as it is now, should be provided (which we might not), then i will have implemented every single suggestion you have made for the last 6 weeks (think Session, Connection, etc). 0.2, which has taken me the past six weeks to write, is basically all your idea. So, theres hardly any reason to think your ideas are not being heard !


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to