This is an IBM Automation portal for Cloud Platform products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
This was delivered in Liberty 22.0.0.6.
I want to add more context to this request. This request is to improve EclipseLink's performance for DB2 queries by altering parameter binding behavior.
By default, EclipseLink disables parameter binding for queries that contain function expressions (like ABS, SQRT, or CASE expressions). EclipseLink makes this decision to disable binding for the WHOLE query when EclipseLink parses any function in the query. I think the best way to describe this request is with some examples.
Example 1:
```
Query query = em.createQuery("SELECT s FROM SimpleEntity s WHERE s.intVal1 = ?1 AND s.intVal2 = ?2");
query.setParameter(1, 16);
query.setParameter(2, 26);
```
With Example 1, EclipseLink creates and executes the following SQL query:
```
SELECT ID, INTVAL1, INTVAL2, STRVAL1 FROM SIMPLEENTITY WHERE ((INTVAL1 = ?) AND (INTVAL2 = ?))
bind => [16, 26]
```
EclipseLink binds the given parameters as query parameters. This allows the query to be stored with parameters in the prepared statement cache and improves performance.
Example 2:
```
Query query = em.createQuery("SELECT s FROM SimpleEntity s WHERE s.intVal1 = ?1 AND s.intVal2 = ?2 AND s.intVal1 = ABS(36)");
query.setParameter(1, 16);
query.setParameter(2, 26);
```
With Example 2, EclipseLink creates and executes the following SQL query:
```
SELECT ID, INTVAL1, INTVAL2, STRVAL1 FROM SIMPLEENTITY WHERE (((INTVAL1 = 16) AND (INTVAL2 = 26)) AND (INTVAL1 = ABS(36)))
```
When EclipseLink parses the JPQL query and constructs the SQL, EclipseLink disables parameter binding for the whole query. This is a decision that EclipseLink makes, for DB2, regardless of validity. In other words, EclipseLink makes this decision at a very high level, for all functions. It does this because there are known function expressions that are invalid to use parameter markers on DB2. For instance, it is illegal in DB2 for CASE expressions to contain untyped parameter markers in the THEN and ELSE `result-expression` (https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/codes/src/tpc/n418.html). Rather than making a fine, detailed decision, EclipseLink disables all parameter binding for the query if any function appears in the query.
This RFE requests allowing EclipseLink to make a finer detailed decision and partially allowing parameter binding decisions.
For instance, instead, the SQL EclipseLink would generate for Example #2 would be:
```
SELECT ID, INTVAL1, INTVAL2, STRVAL1 FROM SIMPLEENTITY WHERE (((INTVAL1 = ?) AND (INTVAL2 = ?)) AND (INTVAL1 = ABS(36)))
bind => [16, 26]
```
With this RFE, EclipseLink would allow partial parameter binding instead of globally making the decision for the whole query. This will require a change to EclipseLink's JPQL parsing behavior and a large amount of testing. However, the performance benefit would allow more database cache hits and increased performance.