[dbapi] retire repo.commit/rollback which was used by the dbapi
Related to #3933480.
--- a/server/repository.py Tue Mar 17 15:46:40 2015 +0100
+++ b/server/repository.py Tue Mar 17 15:55:52 2015 +0100
@@ -694,30 +694,6 @@
session = self._get_session(sessionid, setcnxset=False)
session.set_shared_data(key, value, txdata)
- def commit(self, sessionid, txid=None):
- """commit transaction for the session with the given id"""
- self.debug('begin commit for session %s', sessionid)
- try:
- session = self._get_session(sessionid)
- session.set_cnx(txid)
- return session.commit()
- except (ValidationError, Unauthorized):
- raise
- except Exception:
- self.exception('unexpected error')
- raise
-
- def rollback(self, sessionid, txid=None):
- """commit transaction for the session with the given id"""
- self.debug('begin rollback for session %s', sessionid)
- try:
- session = self._get_session(sessionid)
- session.set_cnx(txid)
- session.rollback()
- except Exception:
- self.exception('unexpected error')
- raise
-
def close(self, sessionid, txid=None, checkshuttingdown=True):
"""close the session with the given id"""
session = self._get_session(sessionid, txid=txid,
--- a/server/test/unittest_repository.py Tue Mar 17 15:46:40 2015 +0100
+++ b/server/test/unittest_repository.py Tue Mar 17 15:55:52 2015 +0100
@@ -491,7 +491,6 @@
self.assertEqual(tuplify(data), [(-1, 'Personne', 'system', None)])
self.repo._delete_cascade_multi(cnx, [entity])
self.repo.system_source.delete_info_multi(cnx, [entity])
- #self.repo.commit()
cu = cnx.system_sql('SELECT * FROM entities WHERE eid = -1')
data = cu.fetchall()
self.assertEqual(data, [])