Can't Add Record To Table

Ivan Smahin ivan_smahin at paradigmasoft.com
Wed Sep 22 07:01:27 CDT 2010


Hello Warren,

Wednesday, September 22, 2010, 2:36:43 PM, you wrote:

> I added the db_close and this worked.  The records now show up.  This brings up a question....
>  
> Should I ...
>  
> 1) do a db_open when I open my application and a db_close when I end my application?
>  
> -or-
>  
> 2) do a db_open when I update my database and a db_close when I finish updating?
>  
>

You  should open db in order to use it. Without it you will get
errors like "Db is not opened"

You should close db in order to close db files.
BTW,  closing db cause db-files flushes. Without it you may loose your
changes (unpredictable part of your changes).

db_flush  is  flushing  all  changes  to the disk. After this all your
changes are fixed on disk.

> The reason I am asking the above question is if you have to do a
> db_close for the updates to completed.  I am worried that if I do a
> db_close when the application completes, I could lose data if the application closes unexpectedly.
>
> Same with the db_flush...when should this be done?
>  

db_close  just  causes  db_flush.  Normally you should not call db_flush
after each update but you may do it on some basis in order to get some
protection from crashes.
On  the other hand crash is the thing which should be cured. You would
not live with it anyway.


Also  pay attention to Valentina errors and how you may handle them (see
examples and wiki)


-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list