You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Clockrun Ren (JIRA)" <ji...@apache.org> on 2018/09/20 07:30:00 UTC

[jira] [Commented] (OLINGO-1277) Olingo Java v2 JPA processor concurrency problems while building a query

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

Clockrun Ren commented on OLINGO-1277:
--------------------------------------

I have same issue here.

Set it as volatile might have performance issue. I would propose to set it ThreadLocal as a simple workaround, or alternatively make it completely thread safe.

> Olingo Java v2 JPA processor concurrency problems while building a query
> ------------------------------------------------------------------------
>
>                 Key: OLINGO-1277
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1277
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.10
>            Reporter: Nikolay
>            Priority: Major
>         Attachments: olingo.png
>
>
> When querying simultaneously several filter queries similar to 
> {endpoint}/Logs/$count?$filter=(level%20eq%20%27ERROR%27)%20and%20(timeStamp%20ge%20datetime%272018-07-13T08:15:52%27%20and%20timeStamp%20le%20datetime%272018-07-13T09:15:52%27)
>  
> some of them fail due to concurrency problems - the query parameters get mixed to different JPA queries:
> org.hibernate.QueryException: Named parameter [1] not set
>  at org.hibernate.query.internal.QueryParameterBindingsImpl.verifyParametersBound(QueryParameterBindingsImpl.java:251)
>  at org.hibernate.query.internal.AbstractProducedQuery.beforeQuery(AbstractProducedQuery.java:1313)
>  at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1412)
>  at org.hibernate.query.Query.getResultList(Query.java:146)
>  at org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.process(JPAProcessorImpl.java:233)
> java.lang.IllegalArgumentException: Unknown parameter position: 1
>  at org.hibernate.query.internal.QueryParameterBindingsImpl.getBinding(QueryParameterBindingsImpl.java:240)
>  at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:503)
>  at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:104)
>  at org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.setPositionalParametersToQuery(JPAProcessorImpl.java:207)
>  at org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.process(JPAProcessorImpl.java:232)
>  
> If the oDataJPAContext in JPAProcessorImpl is volatile, the problem doesn't occur any more.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)