Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Prod error - Attempt to set a parameter name that does not occur in the SQL : BindvariableName

MozakkirFeb 15 2017 — edited Feb 15 2017

Hello,

I am using Jdev 12.2.1.1.0

I am getting below error only in production.

Attempt to set a parameter name that does not occur in the SQL : BindvarName

I have a viewObject where I have defined a view criteria as shown below. Please note that BindvarName is a view criteria level bind variable and there is no bind variable defined at sql level in my view object

<Variable

Name="BindvarName"

** Kind="viewcriteria"**

Type="java.lang.String"/>

vc.jpg

I am calling below method to execute the view criteria

public Row findUserDetailsByNationalId(String nationalId) {

    ViewObjectImpl userDetailsVO = this.getXxUserDetailsVO1();

    ViewCriteria userDetailsVC = userDetailsVO .getViewCriteria("findByNationalId");

    userDetailsVO .applyViewCriteria(userDetailsVC );

    userDetailsVO .setNamedWhereClauseParam("BindvarName", nationalId);

    userDetailsVO .executeQuery();

    if (userDetailsVO != null) {

        Row row = userDetailsVO .first();

        userDetailsVO .clearViewCriterias();

        return row;

    }

    userDetailsVO .clearViewCriterias();

    return null;

}

This works perfectly most of the time however when there is huge traffic in my application i get the error Attempt to set a parameter name that does not occur in the SQL : BindvarName

Is perAllPeopleVO.clearViewCriterias(); can cause a problem?

when this method gets called multiple time. Is this a good practice.

Clearing viewCriteria gives me confident that we are not caching old values in view criteria and every time this method gets called, we have a fresh criteria with new bind parameter value

Please advice

Thanks,

Mozakkir

This post has been answered by Timo Hahn on Feb 15 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2017
Added on Feb 15 2017
2 comments
1,660 views