Bug #71525 IS_CONNECTED() IS CHECKED EVERY TIME A STATEMENT IS EXECUTED
Submitted: 30 Jan 2014 12:21 Modified: 13 Jan 2015 7:53
Reporter: Alfranio Correia Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Fabric Severity:S3 (Non-critical)
Version:1.4.0 OS:Any
Assigned to: Alfranio Correia CPU Architecture:Any

[30 Jan 2014 12:21] Alfranio Correia
Description:
is_connected() is checked every time a statement is executed. This is not 
really necessary and reduces the overall performance. 

How to repeat:
Check the code: 

def exec_mysql_stmt(cnx, stmt_str, options=None): 
    ... 
    if cnx is None or not cnx.is_connected(): 
        raise _errors.DatabaseError("Invalid database connection.")

Suggested fix:
Improve the code and check whether a connection is fine or not only right after retrieving it from the pool.