Simon Slavin
> Thu, 14 Jul 2011 09:24:35 -0700
> On 14 Jul 2011, at 5:13pm, Mattia wrote:
> > So actually what I do is:
> > - run the application;
> > - make a copy of the database;
> > - select to see what lies inside a table;
> > - an insert/delete/insertupdate (obtained from a string) to that table
> > in the db-copy;
> > - another select, with correct results;
> > - closing the connection, disposing the command;
> > - deleting the old database and rename the db-copy with the correct name.
> > - checking the database with sqlite-administrator: same as before the
> > execution.
> You described your problem well but your list is a little unclear.  I'm
> asking
> for more information so we can understand what you do.
> Let us call the copy on disk before the application runs 'a.sqlite'.
> Let us call the copy that the application makes 'b.sqlite'.
> Please give us the above sequence again using those names, including
> (a) which database file you use in each operation
> (b) how you copy the database (shell command ?  read and write file ?
>  sqlite
> commands ?)
> (c) where you open the database and which copy/copies you open
> (d) how you delete the old database
> Also I am not sure what you mean by 'disposing the command'.  Please
> explain.
> Also please check the database using sqlite3 command-line tool found on the
> sqlite web site, not sqlite-administrator.  Your bug may be in
> sqlite-administrator.
> Simon.


Hi, thank you for your reply.
I hope this mail will be delivered correctly, I messed up with the options
of the list so ...well, I just cross the fingers.

Anyway, in here you have the code of what I did, maybe it's more helpful
than my list of things done in C#, with System.Data.SQLite 1.074 and SQLite
3.7.7.1:
http://pastebin.com/X2EY31vR

The list updated with  your suggestions is...:

- run the application, I have data.db;
- make a copy of the database (new.db is the copy);
- select to see what lies inside a table in new.db;
- an insert/delete/insertupdate (obtained from a string) to that table
in the new.db;
- another select, with correct results, in new.db;
- closing the connection to new.db and disposing the command;
- deleting the old database (data.db) and renaming new.db with the
correct name (new.db becomes data.db).
- checking the database with sqlite-administrator: same as before the
execution. I controlled both data.db and new.db, just to be sure: no
modification submitted.


To create the databases and remove them I use the IO of the framework
.Net. So, to create a copy of the database I just do
File.Copy(data.db, new.db).

I'll do that attempt with the command-line tool :)

Thank  you for the help,

Mat.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to