classification
Title: sqlite3, valued records not persisted, default ones are
Type: behavior Stage:
Components: Demos and Tools Versions: Python 3.2
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: debewerker, peter.otten, r.david.murray
Priority: normal Keywords:

Created on 2013-08-31 07:10 by debewerker, last changed 2013-08-31 10:33 by debewerker. This issue is now closed.

Files
File name Uploaded Description Edit
dump.py debewerker, 2013-08-31 07:10 demo to show problem
Messages (6)
msg196617 - (view) Author: Heijink (debewerker) Date: 2013-08-31 07:10
In the end I tracked down the behaviour with the attached program
behaviour with an initially empty table:

7 : insert two records with values in the columns
two records show up, # 1,2
as expected
9 : show al records
none
whereas two are to be expected
8 : add records with default values
two records show up # 1,2
as expected in an empty table
7
two records # 3,4
record numbers as expected, but where are records 1,2?  (ABC)
9
the default records are present #1,2
the previous valued records 3,4 not
  unexpected, but identical to first behaviour issuing 7
8
4 records show up # 1-4
record numbers as expected when valued records are not present
0  :  I quit

to summarize:
It is not possible to store records in the database with valued columns.
Records with default values can be stored and retrieved, they are the ones that are persistent
Additional strange behaviour is that after adding valued records (3,4) also the already present records with default values (1,2) should have shown show up, remark (ABC).
msg196619 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-08-31 07:21
What happens if you actually call commit()?
msg196621 - (view) Author: Heijink (debewerker) Date: 2013-08-31 07:32
your suggestion is a bit to cryptic for me
- you mean intermediate messages from Python: there are none
- you mean to change a command in another format
  newbie with programming experience
  drop me a program line / show three records where one is your alternative
msg196623 - (view) Author: Peter Otten (peter.otten) * Date: 2013-08-31 07:48
David means you should replace the line

conn.commit

in your script which does not invoke the method with

conn.commit()

Side note: as long as you are a newbie it is a good idea to ask on the python mailing list first before adding a report to the bug tracker.
msg196624 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-08-31 07:52
Sorry, I didn't mean to be cryptic.  Yes, Peter has figured out what I was trying to say.
msg196628 - (view) Author: Heijink (debewerker) Date: 2013-08-31 10:33
that did the trick, my confidence is restored.

sorry to have bothered you, I could have found in myself, by comparing differences. Just staring blind after many attempts. 
I did look in the list, but could not find an issue that matched my description of the problem.

I closed the subject
History
Date User Action Args
2013-08-31 10:33:56debewerkersetstatus: open -> closed

messages: + msg196628
2013-08-31 07:52:20r.david.murraysetmessages: + msg196624
2013-08-31 07:48:29peter.ottensetnosy: + peter.otten
messages: + msg196623
2013-08-31 07:32:18debewerkersetmessages: + msg196621
2013-08-31 07:21:09r.david.murraysetnosy: + r.david.murray
messages: + msg196619
2013-08-31 07:10:38debewerkercreate