ScriptUtils executeSqlScript() method has a default comment delimiter of /* and */.
This markers are used by Oracle for hints. For example:
SELECT/*+ DRIVING_SITE (BA) leading (BA S SR) FULL(BA) PARALLEL(BA 4) PARALLEL(S 4) PARALLEL(SR 4) */BA.CUSTOMERFROM.....
These hints, when added, are crucial for db performance in production. We recently noticed in a production environment that these hints in an SQL file executed by ScriptUtils was ignored. After looking at the code, we saw that the hints were simply removed.
We solved this issue by calling the overloaded executeSqlScript method that takes specific delimiters, and used "fake" delimiters (##/* and */##) in order to get the hints working again. However, I feel this should not be the correct approach as default.
Suggestions would be:
Implement a different behavior based on the JDBC driver being used: In case of Oracle, don't ignore these "comments".
Alternatively, Take into account the full /*+ marker as not being a comment (although that might not be a solution for all Oracle hints).