[Tux4kids-commits] r1383 - tux4kids-admin/trunk/libtux4kidsadmin
Michał Świtakowski
swistakers-guest at alioth.debian.org
Wed Aug 5 22:33:42 UTC 2009
Author: swistakers-guest
Date: 2009-08-05 22:33:42 +0000 (Wed, 05 Aug 2009)
New Revision: 1383
Modified:
tux4kids-admin/trunk/libtux4kidsadmin/schoolDatabase.cpp
Log:
improved performance with transactions
Modified: tux4kids-admin/trunk/libtux4kidsadmin/schoolDatabase.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin/schoolDatabase.cpp 2009-08-05 22:32:09 UTC (rev 1382)
+++ tux4kids-admin/trunk/libtux4kidsadmin/schoolDatabase.cpp 2009-08-05 22:33:42 UTC (rev 1383)
@@ -279,11 +279,13 @@
Q_Q(SchoolDatabase);
emit q->classAdded(newClass);
}
- //db.transaction();
+ getClassId.finish();
+
+ db.transaction();
if (addClassTeachers(newClass)) {
addClassStudents(newClass);
+ db.commit();
}
- //db.commit();
}
}
@@ -322,9 +324,8 @@
lastError = "Multiple profile_name-s in database";
return false;
}
-
-
int studentId = findStudentId.value(0).toInt();
+ findStudentId.finish();
QSqlQuery addStudent;
addStudent.prepare("INSERT INTO class_students(id_class, id_student) VALUES(:id_class, :id_student);");
More information about the Tux4kids-commits
mailing list