1- # $Id: back_sqlite.py,v 1.18 2004-03-21 23:39:08 richard Exp $
1+ # $Id: back_sqlite.py,v 1.19 2004-03-21 23:45:44 richard Exp $
22'''Implements a backend for SQLite.
33
44See https://pysqlite.sourceforge.net/ for pysqlite info
99
1010from roundup import hyperdb
1111from roundup .backends import rdbms_common
12- from roundup .backends import locking
1312import sqlite
1413
1514class Database (rdbms_common .Database ):
@@ -26,13 +25,6 @@ def open_connection(self):
2625 # ensure files are group readable and writable
2726 os .umask (0002 )
2827
29- # lock the database
30- db = os .path .join (self .config .DATABASE , 'db' )
31- lockfilenm = db [:- 3 ] + 'lck'
32- self .lockfile = locking .acquire_lock (lockfilenm )
33- self .lockfile .write (str (os .getpid ()))
34- self .lockfile .flush ()
35-
3628 (self .conn , self .cursor ) = self .sql_open_connection ()
3729
3830 try :
@@ -46,16 +38,6 @@ def open_connection(self):
4638 self .cursor .execute ('create index ids_name_idx on ids(name)' )
4739 self .create_version_2_tables ()
4840
49- def close (self ):
50- ''' Close off the connection.
51- '''
52- self .sql_close ()
53- if self .lockfile is not None :
54- locking .release_lock (self .lockfile )
55- if self .lockfile is not None :
56- self .lockfile .close ()
57- self .lockfile = None
58-
5941 def create_version_2_tables (self ):
6042 self .cursor .execute ('create table otks (otk_key varchar, '
6143 'otk_value varchar, otk_time integer)' )
0 commit comments