[sqlalchemy] Re: Reconnect while loosing Mysql connection

2012-06-12 Thread Pavel Skvazh
Too obvious or too complicated? On Monday, June 4, 2012 7:10:14 PM UTC+4, Pavel Skvazh wrote: > > Hi, everyone! > > Due to an obviously lacking skills of an admin, the connection with Mysql > sever is really spotty. > > And I keep getting OperationalError 'Can't

[sqlalchemy] Reconnect while loosing Mysql connection

2012-06-04 Thread Pavel Skvazh
Hi, everyone! Due to an obviously lacking skills of an admin, the connection with Mysql sever is really spotty. And I keep getting OperationalError 'Can't connect to MySQL server' error every once in a while. What's the best practice approach to handle this kind of errors. Logical way would be

[sqlalchemy] Mysql dialects comparison

2010-04-22 Thread Pavel Skvazh
Hi, everybody! Looks like mysql_python is getting some competition lately. Not that there's a lot to complain about it, but having options never heart anybody. I'd be nice to get a grasp of what's the experience people had with official connector and the our_sql (pure python sounds like not a goo

[sqlalchemy] Re: Textual SQL

2009-02-03 Thread Pavel Skvazh
t;) > print '+ commit()  need to do it yourself' > session1.commit() > > session2 = Session(autocommit=True)  # commit is configurable > print '+ execute() will include commit' > session2.execute("insert into something(stuff) values('some

[sqlalchemy] Textual SQL

2009-02-02 Thread Pavel Skvazh
Session.execute('INSERT INTO SOMETHING SOMETHING / DELETE/ UPDATE') Do I have to call Session.commit() after this or it's already taken care of? In other words does the literal sql statements follow the session transaction rules or they act on there own? And since this works and worked for me fo

[sqlalchemy] Re: how to print a constructed query with it's parameters?

2008-10-17 Thread Pavel Skvazh
Thanks for the solution! But i get the warning for this query: SELECT address.name AS address_lang, "user".name AS user_name FROM addresses LEFT OUTER JOIN "user" ON "user".id = address.user_id Throws sqlalchemy-0.5.0rc2dev_r5150-py2.5.egg\sqlalchemy\sql\expression.py: 1616: SAWarning: Column 'n

[sqlalchemy] Re: Storing DB engine in session

2007-10-17 Thread Pavel Skvazh
Thanks a lot, Paul. Great point, works just great. That pretty much solved the issue. log_dic log_typle = (session['login'], session['password']) if not log_dic.has_key((log_typle)): engine = create_engine(uri) log_dic[log_typle] = engine e

[sqlalchemy] Storing DB engine in session

2007-10-17 Thread Pavel Skvazh
I've been struggling with this problem for a long time now and will appreciate any help. I'm using Oracle and pass users/passwords to access the database. uri = 'oracle://' + config.get('sqlalchemy_conf.webuser', '') + ':' + config.get('sqlalchemy_conf.webpassword', '') + '@' + bd_location engine

[sqlalchemy] Oracle sequences issue

2007-08-14 Thread Pavel Skvazh
I'm trying to make sequences in the Oracle database. Here's my model def init(): #conf = paste.deploy.CONFIG #uri = conf['sqlalchemy.dburi'] if 'login' in session: uri=1 else: conf = paste.deploy.CONFIG uri = conf['sql

[sqlalchemy] Oracle sequences issue

2007-08-14 Thread Pavel Skvazh
I'm trying to make sequences in the Oracle database. Here's my model def init(): #conf = paste.deploy.CONFIG #uri = conf['sqlalchemy.dburi'] if 'login' in session: uri=1 else: conf = paste.deploy.CONFIG uri = conf['sql