python, Mysql_python, storm problem

Discussion in 'Python' started by paul Batoum., Apr 8, 2008.

  1. paul Batoum.

    paul Batoum. Guest

    I am actually tryng to build a database apps in python + storm which use
    MySQLdb 1.2.2
    i actually want the auto reconnect feature of storm, which just need to
    change the False param of raw_connect to True in storm/databases/mysql.py so
    far nothing really difficult but from there i got quite a weird result:

    if i try the following code, it works in the shell python interpreter but
    not when i put it in a test.py file and call it as python test.py (will be
    helpfull for unittest):

    So to make it simple the MySQL reconnect work in the shell interpreter and i
    got a DisconnectionError: (2006, 'MySQL server has gone away') when i use it
    the other way.

    Let me know if one of you have ever experienced something like that

    Thx

    Code:

    import database
    import time

    # Test timeout cases
    pdb = database.Database(connect_info)
    res = pdb.execute(u"SHOW VARIABLES LIKE 'wait_timeout'")
    # set the timeout to 3 sec
    pdb.execute("SET wait_timeout=3")
    res = pdb.execute(u"SHOW VARIABLES LIKE 'wait_timeout'")
    res = pdb.execute("select * from country")
    time.sleep(5)
    # try a new execute, this one should pass
    res = pdb.execute("select * from country")


    --
    View this message in context: http://www.nabble.com/python,-Mysql_python,-storm-problem-tp16547127p16547127.html
    Sent from the Python - python-list mailing list archive at Nabble.com.
    paul Batoum., Apr 8, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. www.killerappcompany.com

    bizarre new invention takes world by storm

    www.killerappcompany.com, Jul 3, 2006, in forum: HTML
    Replies:
    0
    Views:
    343
    www.killerappcompany.com
    Jul 3, 2006
  2. Bruza
    Replies:
    2
    Views:
    5,368
    Bruza
    Dec 18, 2007
  3. Dan Barbus

    elixir vs. storm

    Dan Barbus, Mar 11, 2009, in forum: Python
    Replies:
    1
    Views:
    602
    Bruno Desthuilliers
    Mar 11, 2009
  4. chen selina
    Replies:
    0
    Views:
    879
    chen selina
    Jul 7, 2010
  5. David Heinemeier Hansson

    [ANN] Instiki 0.3.0: Before the Storm

    David Heinemeier Hansson, Apr 9, 2004, in forum: Ruby
    Replies:
    5
    Views:
    135
    David Heinemeier Hansson
    Apr 12, 2004
Loading...

Share This Page