[Qt-interest] SQL transactions on QSqlQueryModel/QTableView

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Fri Jun 12 01:53:16 CEST 2009


Hi Marcelo, 
 
I use FB and set the transactions using the QSqlDatabase methods.  I only
use QSqlQuery.  
 
Note there used to be a design bug in the Qt classes related to SqlTable.
It holds an edit query, and reuses it if the generated update statement is
the same.  But there is no mechanism for the driver to tell the edit query
that the previous transaction has finished and another one started. This
causes the useless 'a system error has occurred message' from fb, because it
cannot handle queries open across transaction boundaries.  I'm not sure
whether that can affect QSqlQueryModel as well.  
 
Good Luck!  
 
Tony. 
 
 

To supplement, I'm using the Firebird database and to change the transaction
type to "snapshot" in a SELECT. The QT documentation says little about it.

Thanks for help.
Marcelo E. Geyer


Hi guys,

How best to work with transactions with QSqlQueryModel and QTableView? My
question is how and when the commit call as appropriate, since the
QTableView is doing a fetch from the database.

Thanks,

Marcelo E. Geyer
Brazil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090612/c7873419/attachment.html 


More information about the Qt-interest-old mailing list