<div dir="ltr"><div>Oh.I'm not along. That's good (or bad).</div><div><br></div>Normally you don't get any problems, because "created time" is equal and the wrong modified time won't be recognized by anybody, I think.<div>
You could edit the record without any problems and delete, too. The second record, which disappear will be recognized mostly after a long time and taken in the box "employee are idiots, why they delete this"</div>
<div>But I use the Webservice as Layer between my Extensions and the vtiger. And they will check if the ModuleName I submit is equal to setype in database.</div><div><br></div><div>@Michael: Connection pooling could really cause problems, like I read in the web. But was not the problem in my case.</div>
<div><br></div><div><b>The Question I have for the vtigerCRM developers: Won't it be better to use AutoIncrement for crmid column?</b> I think the DBMS could handle multiple access at the same time very well.</div><div>
All "big" DBMS will support this. (PostgreSQL, MSSQL, MySQL, Oracle, SQlite) Did anybody use another one?</div><div><br></div><div>Stefan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 2:05 PM, Joe Bordes <span dir="ltr"><<a href="mailto:joe@tsolucio.com" target="_blank">joe@tsolucio.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>I agree, I had noticed this also
      although we haven't run into the problem either (at least that we
      know of).<br>
      <br>
      +1<div><div class="h5"><br>
      <br>
      On 08/01/14 13:48, Zygmuntowicz Michal wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      
      
      <div><font face="Arial">I did not hit this problem (or
          maybe I just did not notice it), but recently I took a look</font></div>
      <div><font face="Arial">at the adodb library GenID
          function that creates unique IDs for sequences and for me it
          seems</font></div>
      <div><font face="Arial">that this function may not be
          safe under some circumstances.</font></div>
      <div> </div>
      <div><font face="Arial">Most objects use the singleton
          instance of the global $adb PearDatabase object.</font></div>
      <div><font face="Arial">1. The genID function of the
          underlaying adodb object is not thread safe, as it uses</font></div>
      <div><font face="Arial">   $this->genID to store
          intermediate result and return it upon function exit.</font></div>
      <div><font face="Arial">   But this should not be an
          issue, as script execution is single-threaded and each</font></div>
      <div><font face="Arial">   HTTP request will get its own
          $adb object.</font></div>
      <div><font face="Arial">2. The genID function is using
          last_insert_id, which works only if the database connection</font></div>
      <div><font face="Arial">    is used only by a single
          script and single thread. I don't know what happens</font></div>
      <div><font face="Arial">    if the web server uses
          connection pooling. Maybe it is possible that the same
          database</font></div>
      <div><font face="Arial">    connection </font><font face="Arial">is shared between concurrent HTTP
          requests and therefore last_insert_id</font></div>
      <div><font face="Arial">    may return incorrect values.</font></div>
      <div style="FONT:10pt Tahoma"><font face="Arial">3. I am not sure
          if the sequence tables should be locked - I guess
          autoincrement columns</font></div>
      <div style="FONT:10pt Tahoma"><font face="Arial">    should be
          transaction safe.</font></div>
      <div style="FONT:10pt Tahoma"> </div>
      <div style="FONT:10pt Tahoma"><font face="Arial">These are only
          my thoughts - I think someone with good understanding of the
          web server/mysql/php</font></div>
      <div style="FONT:10pt Tahoma"><font face="Arial">interactions
          should throw some light on this.</font></div>
      <div style="FONT:10pt Tahoma"><br>
      </div>
      <div style="FONT:10pt Tahoma;BACKGROUND:#f5f5f5">
        <div><b>From:</b> <a title="ich@stefanwarnat.de" href="mailto:ich@stefanwarnat.de" target="_blank">Stefan Warnat</a> </div>
        <div><b>Sent:</b> Wednesday, January 08, 2014 12:05 PM</div>
        <div><b>To:</b> <a title="vtigercrm-developers@lists.vtigercrm.com" href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a>
        </div>
        <div><b>Subject:</b> [Vtigercrm-developers] Duplicate CRMIDs
          5.40</div>
      </div>
      <div><br>
      </div>
      <div dir="ltr">Hy,
        <div><br>
        </div>
        <div>Yesterday I found a very strange situation in one of my
          clients vtiger 5.4 systems.</div>
        <div>The System ~250k records contains Leads with a leadid,
          which isn't a "setype LEAD" in vtiger_crmentity.</div>
        <div>Some are Contacts, other Accounts, Tickets, ...</div>
        <div>Also the ID exist correctly in the respective tables of
          contacts, accounts, ...</div>
        <div><br>
        </div>
        <div>I create the following problem situation:</div>
        <div>Two records are created in absolutely the same moment. (The
          createdtime column is completely equal)</div>
        <div>Because ADODB don't lock the sequence table, there could be
          a chance of duplicate crmid's, I suspect.</div>
        <div>I'm not fully sure how safe the used "LAST_INSERT_ID(id+1)"
          is. </div>
        <div>The normal "LAST_INSERT_ID()" is per connection, but only
          get back a auto increment.</div>
        <div><br>
        </div>
        <div>Anyone other with this problem?</div>
        <div><br>
        </div>
        <div>Stefan</div>
      </div>
      <p>
      </p>
      <hr>
      _______________________________________________<br>
      <a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <br>
    <pre cols="72">-- 
Un saludo
Joe
TSolucio</pre>
  </font></span></div>

<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div>