if ((transaction=m_dbm->DBM_setTransaction(this))==true)
{
if (m_dbm->DBM_updateTestCase(testCase,this))
//in update TestCase is several insertions and updates called. I execute in this function several queries
{
if (m_dbm->DBM_commit(this))
QMessageBox::information(this,
"Message",
QString("TestCase table has been successfully updated"),
}
else
{
m_dbm->DBM_callRollback(this);
}
}
else
{
if (m_dbm->DBM_updateTestCase(testCase,this))
QMessageBox::information(this,
"Message",
QString("TestCase table has been successfully updated"),
else
}
if ((transaction=m_dbm->DBM_setTransaction(this))==true)
{
if (m_dbm->DBM_updateTestCase(testCase,this))
//in update TestCase is several insertions and updates called. I execute in this function several queries
{
if (m_dbm->DBM_commit(this))
QMessageBox::information(this,"Message", QString("TestCase table has been successfully updated"),
QMessageBox::Ok, QMessageBox::NoButton );
}
else
{
m_dbm->DBM_callRollback(this);
QMessageBox::information(this,"Message", QString("Update of TestCase table has failed"),
QMessageBox::Ok, QMessageBox::NoButton );
}
}
else
{
if (m_dbm->DBM_updateTestCase(testCase,this))
QMessageBox::information(this,"Message", QString("TestCase table has been successfully updated"),
QMessageBox::Ok, QMessageBox::NoButton );
else
QMessageBox::information(this,"Message", QString("Update of TestCase table has failed"),
QMessageBox::Ok, QMessageBox::NoButton );
}
To copy to clipboard, switch view to plain text mode
Now, when my insertion fails (which i know by qsqlquery messages) shown code doesn't rolls back data inserted in function DBM_updateTestCase. I don't know what am I doing wrong. Thanx for any reply.
Bookmarks