Re: [Twisted-Python] Strange error: SQL-Server tries to rollback

2010-09-10 Thread Tim Allen
On Fri, Sep 10, 2010 at 06:54:34PM +0300, Pantelis Theodosiou wrote: > sql = ''.join( > [ > "INSERT INTO fts_data VALUES (" > , "'" , serialNumber , "'" > , "," , "'" , customerAccount , "'" > , "," , "'" , dateAndTime ,

Re: [Twisted-Python] Strange error: SQL-Server tries to rollback

2010-09-10 Thread Pantelis Theodosiou
On Fri, Sep 10, 2010 at 7:39 PM, Paul Goins wrote: > Thanks for the code example. > > I can't offer to take this work over, but maybe I can make a comment. > There's one part that stands out to me. > > > try: > > deferred = self.dbpool.runOperation(sql) > > #pri

Re: [Twisted-Python] Strange error: SQL-Server tries to rollback

2010-09-10 Thread Paul Goins
Thanks for the code example. I can't offer to take this work over, but maybe I can make a comment. There's one part that stands out to me. > try: > deferred = self.dbpool.runOperation(sql) > #print("DATA sent") > except Exception as e: > p

Re: [Twisted-Python] Strange error: SQL-Server tries to rollback

2010-09-10 Thread Pantelis Theodosiou
I have no experience with MS SQL, only with PostgreSQL via psycopg2, but the > idea is: > > you want to execute many statements, probably in a blocking fashion: > runInteraction() > you want to execute just one statement: runQuery()/runOperation() > > AFAIK the latter one will do a commit for you i

Re: [Twisted-Python] Strange error: SQL-Server tries to rollback

2010-09-10 Thread Yaroslav Fedevych
On Sep 10, 2010, at 5:17 AM, Pantelis Theodosiou wrote: > I have a simple INSERT INTO statement sent to SQL-Server using pymssql module. > > I use the runOperation method to send the query and I get this strange error. > The data goes through OK and is written in the database but SQL-Server tri

Re: [Twisted-Python] Strange error: SQL-Server tries to rollback

2010-09-10 Thread Paul Goins
Sorry, one more thing. > But how can I use the con.commit method with runOperation and runQuery > that I use in my application? I'm pretty sure ConnectionPools should take care of the commit for you, provided there was no error. If there was an error, then it attempts a rollback. This shoul

Re: [Twisted-Python] Strange error: SQL-Server tries to rollback

2010-09-10 Thread Paul Goins
On 9/10/2010 11:17 AM, Pantelis Theodosiou wrote: > I have a simple INSERT INTO statement sent to SQL-Server using pymssql > module. > > I use the runOperation method to send the query and I get this strange > error. The data goes through OK and is written in the database but > SQL-Server tries to