Hi all and happy new year btw
TL;DR
Our company is about to use Lucee instead of Adobe CFMX 9 for some of out
apps. We’re currently testing our code with Lucee in order to list possible
imcompatibilites.
I’ve noticed a performance issue when calling Oracle stored procedure using
Oracle JDBC driver (ojdbc7.jar but same issue with ojdbc14.jar).
We are not using the provided Oracle datasource type in Lucee because it
cannot be specified an Oracle service name instead of an SID.
I’ve investigated in Lucee source code and the performance issue is caused
by the runtime null value of the schemaPattern parameter passed to
*java.sql.DatabaseMetaData.getProcedureColumns()*I’ve noticed that this
method call is a direct consequence of the Railo issue below which has been
fixed in Railo (which codebase has been inherited in Lucee since the fork).
Issue “tag storedproc fails with oracle” :
https://issues.jboss.org/browse/RAILO-3287
I’ve ran the testcase of this issue (above) in Lucee (latest 4.x version)
but the 1st test case fails while the 2nd succeed.
The 1st test case is expected to call an Oracle function using cfstoredproc
but I doubt Oracle function are expected to be called that way.
Indeed Oracle function can be either called with a simple SQL select
statement or in pure PL/SQL.
Anyway, even if metadata seems to load fast with current parameters value
passed to getProcedureColumns(), this will be very slow in large Oracle
database (say 100 of packages with 100 of stored procedure per package).
The reason is that these parameters values are use to query database
metadata (e.g ALL_TABLES). Passing null as the schemaPattern to
getProcedureColumns() will lead to performance issue…
One solution would consist of commenting the modification of the commit of
RAILO-3287 (see above). This will disable the call to getProcedureColumns().
Another solution in which I got the best performance is when I pass the
following parameters to getProcedureColumns() :
- catalog : Pass the connection schema returned by
java.sql.Connection.getSchema() - schemaPattern : Pass the stored procedure package or an empty string but
not null. - procedureNamePattern : Pass the name of the stored procedure or an empty
string by not null. - columnNamePattern : This is always has null value in Railo and Lucee.
This is the solution I’ve implemented and build in an *.lco file (see
below).
Short version
I’ve implemented and successfully tested my solution (see above) in the
4.5.2.018 branch tag which I’ve cloned locally.
Anyway, I need to know what to do ?
- Should I send a pull request ? What are chances to get it refused ?
- What else ?
Because we are short on our due date we are going to use my patched version
but we will need some manual trick to avoid our patch being overrided when
patching Lucee.