[ 
https://issues.apache.org/jira/browse/OPENJPA-2265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460663#comment-13460663
 ] 

Rick Curtis commented on OPENJPA-2265:
--------------------------------------

Try persisting your key before the master. 

The extra select is when we cascade the relationship from Master->Key and we 
don't know if the other side is new or existing.
                
> An unnecessary select statement appears to be occurring on primary key table
> ----------------------------------------------------------------------------
>
>                 Key: OPENJPA-2265
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2265
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.2.0
>            Reporter: garpinc
>         Attachments: testselect0.zip
>
>
> This issue pertains to 
> http://openjpa.208410.n2.nabble.com/Can-someone-explain-this-OpenJPA-trace-td7580862.html
> Basically I'm seeing an unnecessary select statement of the form:
> 1487  test  TRACE  [main] openjpa.jdbc.SQL - <t 1920940938, conn 488448102> 
> executing prepstmnt 163450945 SELECT t0.otherField1, t0.uniqueField1 FROM 
> KeyClass t0 WHERE t0.pk = ? [params=(long) 0]
> My application does millions of these so performance is suffering. I'll be 
> attaching a test case to illustrate. testselect0.zip

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to