Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Python Mysqldb Threading
rockarolla
post Jul 8 2008, 03:04 AM
Post #1


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 48
Joined: 5-February 08
From: Japan
Member No.: 28,155



I have a small application that spawns several threads which produce output that I insert into the database. The output from one thread is an array and I use
CODE
cursor.executemany
.

In the beginning I was always getting the mysql error
QUOTE
lock time exceeded try to restart the transaction
...I managed to resolve this issue - partially it was coming from IDLE editor and the open python shell - seems they were not unlocking the tables while open - so in order for my code to run I use to run it from the shell ...

The next step to handle this was to lock the table before every insert - despite that each thread is using its own mysql connection ...

At this stage the error still occurs - and this results in loss of data and CPU usage....

Any exerience related to python and mysqldb and executemany and threading will be greatly appreciated!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Python(5)
  2. Python (win32)(1)
  3. [python]got A Problem In My Little Program(1)
  4. What Scripting Language?(2)
  5. Python Versus Java ?(4)
  6. Prove Yourself As A Python Coder - Challenge Site(4)
  7. Pagerank Checksum Algo For Python(0)
  8. Lpt Port And Python(0)
  9. Localizing Python(1)
  10. Help: Multi-threading Trouble In Custom Socket Component(2)
  11. For .net Or Java, Consider Python(1)
  12. Install Python On Xp And Create Two Pop-up Windows In 3 Minutes!(2)


 



- Lo-Fi Version Time is now: 30th August 2008 - 09:24 AM