Edgewall Software

Changes between Version 10 and Version 11 of TracDev/DatabaseApi


Ignore:
Timestamp:
Dec 4, 2009, 10:05:04 PM (14 years ago)
Author:
Christian Boos
Comment:

Note about API corner case, r8878.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/DatabaseApi

    v10 v11  
    2626    return
    2727}}}
     28
     29Note that you should always make sure that `db` won't get garbage collected while  `cursor` is still used, as the collection will do a rollback and close the cursors
     30(avoid in particular doing `cursor = env.get_db_cnx().cursor()`, see r8878).
    2831
    2932The {{{get_db_cnx}}} method looks at the value of the {{{database}}} configuration option in [wiki:TracIni trac.ini], which should contain a database connection URI. The default value for this option tells Trac to use an SQLite database inside the environment directory: