-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

I'm updating some of my code to SQLALchemy 0.6, and I have noted a
problem with the sessionmaker function.

The problem is a compatibility one: old versions use the transactional
parameter, new ones the autocommit parameter.

Usually, to handle these problems I use the try/except method:

try:
    return orm.sessionmaker(bind=bind, autocommit=autocommit)
except TypeError:
    # COMPAT: SQLAlchemy 0.4.x, deprecated in 0.5.x
    transactional = not autocommit
    return orm.sessionmaker(bind=bind, transactional=transactional)


However this does not work, since error is raise only ewhen the actual
Session instance is created.


As far as can understand, the sessionmaker function supports keyword
arguments since user can specify a custom session class to use.

Can error handling be improved?



Thanks  Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktLvVYACgkQscQJ24LbaUSrRQCfab1w/JR+KUNdAo188hEn4NgK
Rf8AoIJR/iGu0xHGTUv09Z3A6sjeydFg
=w5ts
-----END PGP SIGNATURE-----
-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.


Reply via email to