Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325170

Summary: Untranslated log named_argument_not_found_in_query_parameters is in wrong resource
Product: z_Archived Reporter: Michael OBrien <michael.f.obrien>
Component: EclipselinkAssignee: Michael OBrien <michael.f.obrien>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: eclipselink.orm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 325167    
Attachments:
Description Flags
CallQueryMechanism native named argument warning in wrong resource none

Description Michael OBrien CLA 2010-09-13 17:15:38 EDT
>We get a (There is no English translation for this message.) for
                        session.log(SessionLog.WARNING, SessionLog.SQL, "named_argument_not_found_in_query_parameters", new Object[]{field});
defined in TraceLocalizationResource
>This is the place for FINE, FINER, FINEST - not WARNING
                                            { "named_argument_not_found_in_query_parameters", "Missing Query parameter for named argument: {0} 'null' will be substituted." },

>see bug # 325167
[EL Finest]: 2010-09-13 17:08:02.105--UnitOfWork(14463035)--Thread(Thread[main,5,main])--Execute query DataModifyQuery(sql="UPDATE DPAR_SCPROCUNIT SET STATE = 1, PENDINGSTATE = 1, ALU_VERSION = 4 WHERE ((PROCUNIT_ID = 47) AND (ALU_VERSION = 3) AND (PROCUNIT_ID IN (SELECT PROCUNIT_ID FROM #DPAR_SPROCUNIT)))")
[EL Finer]: 2010-09-13 17:08:02.105--ClientSession(28441588)--Connection(27427682)--Thread(Thread[main,5,main])--begin transaction
[EL Warning]: 2010-09-13 17:08:02.105--ClientSession(28441588)--Thread(Thread[main,5,main])--named_argument_not_found_in_query_parameters (There is no English translation for this message.)
[EL Fine]: 2010-09-13 17:08:02.105--ClientSession(28441588)--Connection(27427682)--Thread(Thread[main,5,main])--UPDATE DPAR_SCPROCUNIT SET STATE = 1, PENDINGSTATE = 1, ALU_VERSION = 4 WHERE ((PROCUNIT_ID = 47) AND (ALU_VERSION = 3) AND (PROCUNIT_ID IN (SELECT PROCUNIT_ID FROM ?)))
Comment 1 Michael OBrien CLA 2010-09-14 15:25:22 EDT
[EL Warning]: 2010-09-14 14:51:03.222--ClientSession(20337504)--Thread(Thread[main,5,main])--named_argument_not_found_in_query_parameters (There is no English translation for this message.)
<fixed message for bug# 325170 below>
[EL Warning]: 2010-09-14 15:16:02.052--ClientSession(20796783)--Thread(Thread[main,5,main])--Missing Query parameter for named argument: DPAR_SPROCUNIT null will be substituted.
Comment 2 Michael OBrien CLA 2010-09-14 15:27:01 EDT
Created attachment 178865 [details]
CallQueryMechanism native named argument warning in wrong resource

>Use case is pre rev # 8100
    private void nativeQuery() {
        Query aQuery = null;
        int version = 3;
        StringBuffer aBuffer = new StringBuffer();
        aBuffer.append("UPDATE DPAR_SCPROCUNIT SET STATE = 1, PENDINGSTATE = 1,
ALU_VERSION = ");
        aBuffer.append(version + 1);
        aBuffer.append(" WHERE ((PROCUNIT_ID = 47) AND (ALU_VERSION = ");
        aBuffer.append(version);
        aBuffer.append(") AND (PROCUNIT_ID IN ");
        aBuffer.append("(SELECT PROCUNIT_ID FROM #DPAR_SPROCUNIT)))");
        try {            
            aQuery = getEntityManager().createNativeQuery(aBuffer.toString());
            // Convert to delegate when on EE container - otherwise just return
same EE EM
            setEntityManager(JpaHelper.getEntityManager(getEntityManager()));
            JpaHelper.getDatabaseQuery(aQuery).setIsUserDefined(false);
            // If container managed TX - do not begin/end as SE
            if(JpaHelper.isEclipseLink(entityManagerFactory)) {
                getEntityManager().getTransaction().begin();
            }
            aQuery.executeUpdate();
            if(JpaHelper.isEclipseLink(entityManagerFactory)) {
                getEntityManager().getTransaction().commit();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
Comment 3 Michael OBrien CLA 2010-09-14 15:56:43 EDT
>See SVN rev # 8185(minus CallQueryMechanism prelim change for parent bug # 325167)
https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8185
Comment 4 Michael OBrien CLA 2010-11-09 16:27:23 EST
>This was resolved in the 2.1 stream previously by wrapping the id in a WarningLocalization.buildMessage()
- no 2.1 backport necessary
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:03:36 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink