I want to use an asynchronous connection in a postgrad database to insert a resettime encoding data. I am using twisted TCP communication and I am giving a shot to TxPistgaars for interaction with the database. When I try to add a callback to insert my Asynchronous, I have been standing with a strange message. Try my code here:
Try: conn = txpostgres.ConnectionPool (50 , Params) d = conn.start () def save_conn (c): self.list_cnx.append (c) print str (c), "connect ok" def print_err (m): print md. adclack (lambda _: Savings_Con (conn), lambda __: print_arr ('not connect') Except exception: e "Print can not connect to database! ! "
I am adding reference to the inclusion pool in a list for future queries. Try: test_pool (date_msg, msg) value ('% s', '% s') for c in self.list_cnx:
Enter "% (DIC ['Date'], DIC ['msg']): def insert_finich (): Print" Insert Diniech "def insert_error (): Print" Insert Error "d = c.runOperation (insArRq) ) #Debug d.addCallBack (insert_finich) # Leave a deferred back as mentioned in the document print D # # Exception as error message AE: print "inserted error:", EEWhen I Run Off If I try to add a callback for a deferred return, then this error appears:
& lt; Defined 0x8d9786c & gt; 0x8d at 9782c Insert Error: There is no attribute 'adblockback' in the DAFFORD instance
and sometimes:
& lt; 0x8d97a0c & gt; Insert error: There is no attribute in deferred imaging: 'addClallBack'
Please help me, I is new in deferred concepts, so I think I'm forgetting something. Thanks
The method is named addCallback
; The matter is important.
Comments
Post a Comment