Changeset 1bad318 for src


Ignore:
Timestamp:
04/09/10 14:02:26 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
f548c17
Parents:
5bd6aba
Message:

use transactions to make import faster

Location:
src/sql
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sql/schedulexmlparser.cpp

    r5bd6aba r1bad318  
    3737
    3838    QDomElement scheduleElement = document.firstChildElement("schedule");
     39
     40    SqlEngine::beginTransaction();
    3941
    4042    int confId = 0;
     
    145147        } // parsing day elements
    146148    } // schedule element
     149    SqlEngine::commitTransaction();
    147150
    148151    return confId;
  • src/sql/sqlengine.cpp

    r5bd6aba r1bad318  
    376376}
    377377
     378bool SqlEngine::beginTransaction()
     379{
     380    QSqlDatabase db = QSqlDatabase::database();
     381
     382    return execQuery(db, "BEGIN IMMEDIATE TRANSACTION");
     383}
     384
     385bool SqlEngine::commitTransaction()
     386{
     387    QSqlDatabase db = QSqlDatabase::database();
     388
     389    return execQuery(db, "COMMIT");
     390}
     391
    378392bool SqlEngine::execQuery(QSqlDatabase &aDatabase, const QString &aQuery)
    379393{
  • src/sql/sqlengine.h

    r5bd6aba r1bad318  
    3838        static void addRoomToDB(QHash<QString,QString> &aRoom);
    3939
     40        static bool beginTransaction();
     41        static bool commitTransaction();
     42
    4043        // search Events for ....
    4144        static int searchEvent(int conferenceId, const QHash<QString,QString> &columns, const QString &keyword);
Note: See TracChangeset for help on using the changeset viewer.