[Vtigercrm-developers] Creating Contact records via code. Timing results...

Alan Bell alan.bell at libertus.co.uk
Thu Dec 4 09:35:04 GMT 2014


I was curious because web services must call the regular save operation, 
so should be an overhead, not an optimisation . . .

this is the code in include/webservices/VtigerCRMObject.php in the 
Create function

                 $adb->startTransaction();
                 $this->instance->Save($this->getTabName());
                 $error = $adb->hasFailedTransaction();
                 $adb->completeTransaction();
                 return !$error;

So it does call the normal save operation. I think that wrapping the 
save in a transaction means it does the updates to all the entity tables 
in one hit and reduces the database locks a lot.

would be interesting to do some performance testing without the 
transaction in the webservices code, and adding a transaction wrapper 
around the save method in the non-webservice code.

Alan.

On 04/12/14 09:24, Alan Lord wrote:
> On 04/12/14 08:55, socialboostdk wrote:
>> Almost unbelievably fast..?
>
> Yes, I was amazed too. But both tests ran on the same server, using 
> the same database and the same code apart from the save method itself...
>
> Al
>
>
> _______________________________________________
> http://www.vtiger.com/



More information about the vtigercrm-developers mailing list