Modify ↓
Opened 8 years ago
Closed 8 years ago
#12618 closed defect (fixed)
EnvironmentStub.upgrade fails for in-memory SQLite database
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: |
Fixed |
||
Internal Changes: |
Description (last modified by )
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): 822 822 with self.db_transaction as db: 823 823 participant.upgrade_environment(db) 824 824 # 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() 826 828 del self.database_version 827 829 return True
However, it needs to be explored further before any definite conclusions are drawn.
Attachments (0)
Change History (4)
comment:1 by , 8 years ago
Milestone: | next-stable-1.2.x → 1.2.1 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 8 years ago
Description: | modified (diff) |
---|
comment:3 by , 8 years ago
comment:4 by , 8 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Proposed changes in log:rjollos.git:t12618. I had hoped to avoid putting the comparison
dbm.connection_uri != 'sqlite::memory:'
directly inenv.py
, but I don't see another good way.