Skip to content

Commit b72b368

Browse files
committed
2011-03-20 Tom <[email protected]>
* src/lib/version.py (version): Version --> 0.15.9 * src/lib/shopgui.py (ShopGui.show): Make sure window shows up when something's added. * src/lib/backends/db.py (RecData.initialize_connection): Remove threadlocal strategy. This may be a mistake, but it seems to clear up the commit errors numerous people were experiencing. * src/lib/shopgui.py (ShopGui.__init__): Make sure popup menu gets set-up for changing categories in shopping list.
1 parent 02cc79e commit b72b368

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/lib/backends/db.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,12 @@ def initialize_connection (self):
178178
#print 'Connecting to file ',self.filename,'new=',self.new_db
179179
else:
180180
self.new_db = True # ??? How will we do this now?
181-
self.db = sqlalchemy.create_engine(self.url,strategy='threadlocal')
182-
self.db.begin()
181+
print self.url
182+
#self.db = sqlalchemy.create_engine(self.url,strategy='threadlocal')
183+
#self.base_connection = self.db
184+
self.db = sqlalchemy.create_engine(self.url)
185+
self.base_connection = self.db.connect()
186+
self.base_connection.begin()
183187
self.metadata = sqlalchemy.MetaData(self.db)
184188
# Be noisy... (uncomment for debugging/fiddling)
185189
# self.metadata.bind.echo = True
@@ -202,7 +206,7 @@ def instr(s,subs): return s.lower().find(subs.lower())+1
202206
#c = sqlite_connection.cursor()
203207
#c.execute('select name from sqlite_master')
204208
#sqlite_connection.create_function('instr',2,instr)
205-
self.db.commit() # Somehow necessary to prevent "DB Locked" errors
209+
#self.base_connection.commit() # Somehow necessary to prevent "DB Locked" errors
206210
debug('Done initializing DB connection',1)
207211

208212
def save (self):
@@ -221,7 +225,8 @@ def save (self):
221225
{'last_access':time.time()}
222226
)
223227
try:
224-
self.db.commit()
228+
#self.base_connection.commit()
229+
pass
225230
except IndexError:
226231
print 'Ignoring sqlalchemy problem'
227232
import traceback; traceback.print_exc()

0 commit comments

Comments
 (0)