[Qt-interest] QSqlQuery caching INSERT data?
Jason H
scorp1us at yahoo.com
Fri Nov 20 00:59:47 CET 2009
I haven't seen this for some time...
I wonder what Qt version / QSqlDriver version you have. Autocommit I think is on by default these days...
________________________________
From: Israel Brewster <israel at frontierflying.com>
To: Jason H <scorp1us at yahoo.com>
Cc: QT Mailing LIST <qt-interest at trolltech.com>
Sent: Thu, November 19, 2009 6:47:52 PM
Subject: Re: [Qt-interest] QSqlQuery caching INSERT data?
On Nov 19, 2009, at 2:44 PM, Jason H wrote:
Make sure that you are auto committing transactions, or are manually committing them.
>
>No it does not cache them, but your DB might. I've seen this before, wher SQLite will make a .journal file with the insert content, but won;t be committed because you never commited the transaction. Then, when you run your program again, the .journal is deleted because it doesn't have a completed transaction.
>
Thanks. That sounds like exactly what is happening (I am seeing the journal file), except that I am not using transactions. I did try calling commit(), just for kicks, but it returned false as expected.
>
>
>
>
>
________________________________
From: Israel Brewster <israel at frontierflying.com>
>To: QT Mailing LIST <qt-interest at trolltech.com>
>Sent: Thu, November 19, 2009 4:04:48 PM
>Subject: [Qt-interest] QSqlQuery caching INSERT data?
>
>Does QSqlQuery do any caching of INSERT statements? If so, is there a way to force the cache to be flushed to the database? I have a program that executes a number of INSERT statements using QSqlQuery, but they don't seem to be written to disk until the app quits. Usually this isn't a problem, and is probably a good thing, but there are a couple of places where this doesn't work for me. I tried using a QSqlDatbase::close() command, but this doesn't seem to produce the desired result. I didn't think QSqlQuery did any caching aside from results, which makes me think this is a SQLite process that doing the caching, but I wanted to ask here anyway. Even if it is SQLite, is there some Qt command I could run to make SQLite think I am done and write the data out? Thanks for any advice!
>
>
>-----------------------------------------------
>Israel Brewster
>Computer Support Technician II
>Frontier Flying Service Inc.
>5245 Airport Industrial Rd
>Fairbanks, AK 99709
>(907) 450-7250 x293
>-----------------------------------------------
>
>
>
>
>
>
-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091119/0af2ce01/attachment.html
More information about the Qt-interest-old
mailing list