On Feb 5, 2012, at 11:10 PM, Anthony Foglia wrote:

> 
> If I do shut off the outputtypehandler on the connection, will that
> cause any other problems as I start adding Table objects with the
> appropriate Columns?  Will the connection outputtypehandler be reset
> when it goes back into the pool?  Or should I just keep one connection
> from returning to the pool solely for these old style queries?

The outputtypehandler should only be set on the Connection by SQLAlchemy using 
the same event I gave you, the "connect" event, and it should occur before your 
handler would get to it.   So whatever state you set on it should remain.    
Without the handler, you get back datatypes like str instead of unicode, and 
float instead of Decimal.   The only area that there would be some dependency 
on the type returned is when a TypeEngine, like String, Unicode, or Numeric are 
in use.   The String type should be fine.  The cx_oracle-specific 
implementation of numeric here, which is 
sqlalchemy.dialects.oracle.cx_oracle._OracleNumeric, looks like it might assume 
it's getting a Decimal or string back if that supports_native_decimal flag is 
turned on, so if you're using that type you might need to flip that flag off, 
or do an outputtypehandler similar to the one that's there which just returns 
decimals as strings.

Attached is a patch that allows "coerce_to_decimal" to be passed to 
create_engine() and will disable the output handling if passed as False.   Do 
you want to give it a try, I can commit it for 0.7.6 if it does the trick.



> 
> -- 
> --Anthony
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
> 

Attachment: 2399.patch
Description: Binary data

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to