Edgewall Software

Changeset 3830

Show
Ignore:
Timestamp:
10/03/06 12:29:10 (3 years ago)
Author:
cboos
Message:

Experimental support for pooling pysqlite2 connections, if the SQLite engine used is recent enough to support that (see  SQLite Multi Threading and #3446).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trac/db/sqlite_backend.py

    r3754 r3830  
    135135 
    136136    __slots__ = ['_active_cursors'] 
    137     poolable = False 
     137    poolable = have_pysqlite and sqlite_version >= 30301 
    138138 
    139139    def __init__(self, path, params={}): 
     
    148148                   not os.access(dbdir, os.R_OK + os.W_OK): 
    149149                from getpass import getuser 
    150                 raise TracError, 'The user %s requires read _and_ write ' \ 
    151                                  'permission to the database file %s and the ' \ 
    152                                  'directory it is located in.' \ 
    153                                  % (getuser(), path) 
     150                raise TracError('The user %s requires read _and_ write ' \ 
     151                                'permission to the database file %s and the ' \ 
     152                                'directory it is located in.' \ 
     153                                % (getuser(), path)) 
    154154 
    155155        if have_pysqlite == 2: 
     
    157157            timeout = int(params.get('timeout', 10.0)) 
    158158            cnx = sqlite.connect(path, detect_types=sqlite.PARSE_DECLTYPES, 
     159                                 check_same_thread=sqlite_version < 30301, 
    159160                                 timeout=timeout) 
    160161        else: 
Note: See TracChangeset for help on using the changeset viewer.