<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div><div>I have no experience with MS SQL, only with PostgreSQL via psycopg2, but the idea is:</div>

<div><br></div><div>you want to execute many statements, probably in a blocking fashion: runInteraction()</div><div>you want to execute just one statement: runQuery()/runOperation()</div><div><br></div><div>AFAIK the latter one will do a commit for you if it is needed.</div>

<div><br></div><div>Anyway, for PostgreSQL I can specify isolation level I need.</div></div></div><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote><div><br>thnx to all. I used runOperation with the INSERTs and it was solved (or i think that was the cause).<br><br>The part of code with the problem was:<br><br><span style="font-family: courier new,monospace;">-----------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">from twisted.enterprise import adbapi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">import pymssql</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">class DBAccess:</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    def __init__(self):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        # SQL-Server</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        myhost = &quot;64.x.x.x:4000&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        mydatabase = &quot;db&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        myuser = &quot;user&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        mypassword = &quot;password&quot;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        try:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            self.dbpool = adbapi.ConnectionPool(&quot;pymssql&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                                    , host=myhost</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                                    , user=myuser</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                                    , password=mypassword</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                                    , database=mydatabase</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                                    , cp_noisy=False)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            print(&quot;db connection pool created&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        except Exception as e:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            print(&quot;error starting the ConnectionPool&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            print(e)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    def insertDATA(self</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , serialNumber</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            , customerAccount</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , dateAndTime</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            , camcount</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , fpv</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            , reff</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , restOfFrame</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            ):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        sql = &#39;&#39;.join( </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            [ </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">             &quot;INSERT INTO fts_data VALUES (&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    ,  &quot;&#39;&quot; , serialNumber , &quot;&#39;&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , &quot;,&quot; , &quot;&#39;&quot; , customerAccount , &quot;&#39;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            , &quot;,&quot; , &quot;&#39;&quot; , dateAndTime , &quot;&#39;&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , &quot;,&quot; , camcount</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            , &quot;,&quot; , fpv</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , &quot;,&quot; , &quot;&#39;&quot; , reff , &quot;&#39;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            , &quot;,&quot; , &quot;&#39;&quot; , restOfFrame , &quot;&#39;&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            , &quot;) &quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            ] )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        #print(sql)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        try:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            deferred = self.dbpool.runOperation(sql)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            #print(&quot;DATA sent&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        except Exception as e:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            print(&quot;error in insertDATA&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            print(e)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            return</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        return deferred</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">------------------</span><br><br>Anyway, I&#39;m now stuck at other levels, and I&#39;m kind of out of ideas and the customer wants (or has to) finish the whole project in a  very, very short notice. Like yesterday. And my experience in Python and Twisted is not at the level to solve problems and fix bugs quickly.<br>

<br>Since the program is written using Twisted, if anyone likes to step over, contact me directly and i&#39;ll provide details.   <br></div><br>Pandelis Theodosiou<br></div><br><div style="display: inline;">
</div>