mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
#805 (again): proper fix to avoid blocking when creating a ticket with DBInsert() (instead of DBInsertNoReload !!)
SVN:trunk[3032]
This commit is contained in:
@@ -169,10 +169,19 @@
|
|||||||
<type>Overload-DBObject</type>
|
<type>Overload-DBObject</type>
|
||||||
<code><![CDATA[ protected function DBInsertTracked_Internal($bDoNotReload = false)
|
<code><![CDATA[ protected function DBInsertTracked_Internal($bDoNotReload = false)
|
||||||
{
|
{
|
||||||
$oMutex = new iTopMutex('ticket_insert');
|
// Beware !!!
|
||||||
$oMutex->Lock();
|
// Compensate the fact that CMDBObject::DBInsertTracked_Internal does NOT call the derived version of DBInsertNoReload
|
||||||
|
// when performing an INsert with "no reload" but actually calls it (followed by Reload) when doing an Insert with reload !!
|
||||||
|
if ($bDoNotReload)
|
||||||
|
{
|
||||||
|
$oMutex = new iTopMutex('ticket_insert');
|
||||||
|
$oMutex->Lock();
|
||||||
|
}
|
||||||
$ret = parent::DBInsertTracked_Internal($bDoNotReload);
|
$ret = parent::DBInsertTracked_Internal($bDoNotReload);
|
||||||
$oMutex->Unlock();
|
if ($bDoNotReload)
|
||||||
|
{
|
||||||
|
$oMutex->Unlock();
|
||||||
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
]]></code>
|
]]></code>
|
||||||
|
|||||||
Reference in New Issue
Block a user