We have an application that, for legacy reasons, has most of the string columns in the database defined to use the sql type char[n], not varchar.
It has been working okay using another database dialect; i.e. DB2. However, when we tried running it on an Oracle 10g instance, we're getting empty results sets on our queries.
The team working on the Oracle trial has traced the issue to the query parameter binding. The parms are being bound as VARCHAR, but the column data is char[n]. Apparently, in this test with Oracle, no matching records are found. To verify this was the cause, they changed the column datatypes from char[n] to varchar2(n) and all the queries behave as under DB2.
However, the project is not prepared to migrate our columns to varchar because apparently there is / was a big performance hit in DB2 when using varchar.
So for now, I'm looking for a workaround that could allow us to support an Oracle instance without rejiggering all of the columns to varchars. I thought maybe a specialized Oracle10gDialect could address the issue, but in reading the Dialect JavaDocs, I'm just not sure that's the right answer. I have to believe this has been encountered before, so am hopeful there's a "standard" way to handle it.
I would welcome any advice on how we can work past this issue. (Without changing our column types to varchar!)
FWIW: Hibernate 3.6.5, dialect: Oracle10gDialect
Thank you.
-- jack
|