Edgewall Software

Opened 7 years ago

Last modified 7 years ago

#12618 closed defect

EnvironmentStub.upgrade fails for in-memory SQLite database — at Version 2

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.2.1
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Discussed in gmessage:trac-dev:Ri1Xj1HBNms/2gME805cCQAJ. I didn't explore the issue in detail, but it appears that an effective workaround is to not close the database for in-memory SQLite:

  • trac/env.py

    diff --git a/trac/env.py b/trac/env.py
    index 8790e49..8f37b12 100644
    a b class Environment(Component, ComponentManager):  
    822822            with self.db_transaction as db:
    823823                participant.upgrade_environment(db)
    824824            # Database schema may have changed, so close all connections
    825             DatabaseManager(self).shutdown()
     825            dbm = DatabaseManager(self)
     826            if dbm.connection_uri != 'sqlite::memory:':
     827                dbm.shutdown()
    826828        del self.database_version
    827829        return True

However, it needs to be explored further before any definite conclusions are drawn.

Change History (2)

comment:1 by Ryan J Ollos, 7 years ago

Milestone: next-stable-1.2.x1.2.1
Owner: set to Ryan J Ollos
Status: newassigned

comment:2 by Ryan J Ollos, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.