[esb-issues] [JBoss JIRA] Commented: (JBESB-1246) SqlTableGatewayListener : Field names not handled well in terms of case (Upper/Lowercase)

Mark Little (JIRA) jira-events at lists.jboss.org
Tue Oct 30 05:18:01 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBESB-1246?page=comments#action_12385013 ] 
            
Mark Little commented on JBESB-1246:
------------------------------------

Many of the commercial databases are case insensitive by default, but provide implementation specific ways to do case sensitive searches, e.g., SQLServer 2000:

SELECT myColumn FROM myTable  
    WHERE myColumn COLLATE Latin1_General_CS_AS = 'caSE' 
 
SELECT myColumn FROM myTable  
    WHERE myColumn COLLATE Latin1_General_CS_AS = 'case' 
 
SELECT myColumn FROM myTable  
    WHERE myColumn COLLATE Latin1_General_CS_AS = 'Case' 
 
-- if myColumn has an index, you will likely benefit by adding 
-- AND myColumn = 'case'

If we make our code case insensitive and the db is set up to be case sensitive (so the original jboss-esb.xml was actually correct, for example), then applications will stop working. Why can't we just make is clear that what is in the jboss-esb.xml has to reflect what is in the database?

> SqlTableGatewayListener : Field names not handled well in terms of case (Upper/Lowercase)
> -----------------------------------------------------------------------------------------
>
>                 Key: JBESB-1246
>                 URL: http://jira.jboss.com/jira/browse/JBESB-1246
>             Project: JBoss ESB
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Transports
>    Affects Versions: 4.2.1 IR2
>            Reporter: Tom Cunningham
>         Assigned To: Mark Little
>             Fix For: 4.2.1
>
>
> In SqlTableGatewayListener, a row is grabbed and then turned into a hash, which is checked to change status.     If the case of the field name in the hash doesn't match the case of the field name in jboss-esb.xml, the row will never be updated.      The case in which the drivers return the field name differs from database to database, so we should probably do something here to make the field names case-insensitive by uppercasing what we see in jboss-esb.xml for status_column, message-id-column, order-by-column, etc. and upper casing what is in the currentRow hash.
> I saw problems in MySQL with this code while testing the helloworld_sql_action example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the esb-issues mailing list