]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
change to not using autocommit by default
[dak.git] / daklib / dbconn.py
index 5a7dc52dc1b183b7d32a60ef0004b94616f5e2b7..781e648719a8957d87893fcea07d9334c2f1d406 100755 (executable)
@@ -230,7 +230,7 @@ class ContentFilepath(object):
     def __repr__(self):
         return '<ContentFilepath %s>' % self.filepath
 
-class ContentAssociations(object):
+class ContentAssociation(object):
     def __init__(self, *args, **kwargs):
         pass
 
@@ -643,7 +643,7 @@ class DBConn(Singleton):
         mapper(DBConfig, self.tbl_config,
                properties = dict(config_id = self.tbl_config.c.id))
 
-        mapper(ContentAssociations, self.tbl_content_associations,
+        mapper(ContentAssociation, self.tbl_content_associations,
                properties = dict(ca_id = self.tbl_content_associations.c.id,
                                  filename_id = self.tbl_content_associations.c.filename,
                                  filename    = relation(ContentFilename),
@@ -800,7 +800,7 @@ class DBConn(Singleton):
         self.db_meta.bind = self.db_pg
         self.db_smaker = sessionmaker(bind=self.db_pg,
                                       autoflush=True,
-                                      autocommit=True)
+                                      autocommit=False)
 
         self.__setuptables()
         self.__setupmappers()