Commit 1692db8a authored by Grégory Wisniewski's avatar Grégory Wisniewski

Remove connect() and close() from database API since they make sense only for...

Remove connect() and close() from database API since they make sense only for connection oriented backends.
Note that close() in mysqldb seems never used.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1383 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 288f6087
......@@ -27,13 +27,6 @@ class DatabaseManager(object):
"""
self._under_transaction = False
def connect(self):
"""
Establish the connection to the database
"""
self._connect()
self._under_transaction = False
def begin(self):
"""
Begin a transaction
......@@ -65,13 +58,6 @@ class DatabaseManager(object):
discarded."""
raise NotImplementedError
def close(self):
""" close the database connection """
raise NotImplementedError
def _connect(self):
raise NotImplementedError
def _begin(self):
raise NotImplementedError
......
......@@ -44,9 +44,10 @@ class MySQLDatabaseManager(DatabaseManager):
self.user = kwargs['user']
self.passwd = kwargs.get('password')
self.conn = None
self.connect()
self._connect()
super(MySQLDatabaseManager, self).__init__(**kwargs)
# XXX: unused ?
def close(self):
self.conn.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment