Disappearing Data
Rich Shepard <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
With the patient help of Adrian I fixed the cursor-not-found problem by
copying the connection and cursor to config.py's configData() class which is
imported by all modules. That's working now.
However, and I wonder when it all gets easier, now my entered data are not
being written to the database, but there are no pysqlite or python errors
thrown. I put a bunch of print statements in the method to track progress:
def OnSaveMod(self, event):
modName = self.tcName.GetValue()
modDesc = self.tcDesc.GetValue()
modType = self.rb.GetString(self.rb.GetSelection())
knowlEng = self.keName.GetValue()
method = self.agent.GetSelection()
values = (modName, modDesc, modType, knowlEng, method)
print values
self.appData.cur.execute("insert or replace into model (model_name, \
model_desc, model_type, \
keName, agent) values (?,?,?,?,?)", values)
print "Just tried to enter data in table."
DBtools().SaveDB(self.appData.dbFileName)
print "Returned from DBtools.SaveDB"
What I see on the console is:
(u'foobar', u'Model for testing development.', u'Fuzzy reasoning', u'Rich', -1)
Just tried to enter data in table.
Returned from DBtools.SaveDB
If my interpretation is correct, the data were inserted into the table
'model' (no errors thrown), and everthing looks good. But, when I run sqlite
from the command line and go look at that table, nothing's there:
[rshepard@salmo /data1/eikos]$ sqlite3 foobar.db
SQLite version 3.3.6
Enter ".help" for instructions
sqlite> select * from model;
sqlite>
How do I go about finding what broke when there are no error messages or
other diagnostics?
Thanks,
Rich
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863