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

Kevin Sutter commented on OPENJPA-1092:
---------------------------------------

I wonder if this isn't related to the statement batching support introduced in 
the 1.2.x branch?  As Mike has pointed out, this works on everything past 
1.2.x.  And, the statement batching support definitely affects the order of the 
statements being pushed out to the database.

Although putting the em.flush() into the testcase may resolve this issue on 
1.1.x, we would be implicitly disabling statement batching since now we're 
pushing out every insert to the database when first persisted.  This might 
accidentally cover up other useful test scenarios.  Of couse, if we just limit 
this testcase update to the 1.1.x branch, then that would be safer.  But, I 
don't like to do that just to get a testcase to pass.

Instead of just modifying the testcase, I think the root cause of the problem 
on 1.1.x needs to be determined.  If, after that investigation, it's determined 
that the testcase is incorrect and needs to changed, then we have the proper 
background and reasons.

End of my two cents worth...
Kevin

> enable test case for jpql
> -------------------------
>
>                 Key: OPENJPA-1092
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1092
>             Project: OpenJPA
>          Issue Type: Test
>          Components: jdbc
>    Affects Versions: 1.1.0
>         Environment: OS: windows XP professional 
> java version 1.5.0_14 
>            Reporter: Amy Yang
>            Priority: Minor
>         Attachments: OPENJPA-1092.patch
>
>
> Currently TestEJBQueryInterface is excluded.
> To enable it, just a little change is needed: invoking em.flush() after every 
> em.persist().
> The test case wants to get the result depends on the order of the creation of 
> the entity instance. but we (as well as most other JPA implementations) don't 
> care about the creation order of java instances because the insertion happens 
> when the transaction is committed or flush is invoked. So adding "em.flush()" 
> after "em.persist()" will resolve the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to