You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Ramya (JIRA)" <ji...@apache.org> on 2018/05/21 04:36:00 UTC

[jira] [Commented] (OLINGO-1254) Issue when sending requests in parallel

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

Ramya commented on OLINGO-1254:
-------------------------------

This is fixed as part of the commit https://git-wip-us.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=53b631bffb2b4e5194bdb1d44553b3f43163e2dc
Kindly re-open the issue if it still exists.

> Issue when sending requests in parallel
> ---------------------------------------
>
>                 Key: OLINGO-1254
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1254
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>            Reporter: Fernando Mendel
>            Priority: Critical
>
> Hey,
> We are using the following dependencies from Olingo: 
> {code:xml}
> <dependency>
> <groupId>org.apache.olingo</groupId>
> <artifactId>olingo-odata2-api</artifactId>
> <version>2.0.10</version>
> </dependency>
> <dependency>
> <groupId>org.apache.olingo</groupId>
> <artifactId>olingo-odata2-core</artifactId>
> <version>2.0.10</version>
> </dependency>
> <dependency>
> <groupId>org.apache.olingo</groupId>
> <artifactId>olingo-odata2-jpa-processor-api</artifactId>
> <version>2.0.10</version>
> </dependency>
> <dependency>
> <groupId>org.apache.olingo</groupId>
> <artifactId>olingo-odata2-api-annotation</artifactId>
> <version>2.0.10</version>
> </dependency>
> <dependency>
> <groupId>org.apache.olingo</groupId>
> <artifactId>olingo-odata2-jpa-processor-core</artifactId>
> <version>2.0.10</version>
> </dependency>
> {code}
>  
> When doing two assyncronous requests GET data from OData with different filters, sometimes it works, sometimes it does not.
> Like below queries:
> {code:java}
> "http://localhost:8080/OData/V2/CareCorner.svc/PackageDTOMocks?%24filter=RecipientName%20eq%20'John%20Frank'"
> "http://localhost:8080/OData/V2/CareCorner.svc/PackageDTOMocks?%24filter=RecipientName%20eq%20'Karl%20Mendel'"
> {code}
> The behavior is a bit non deterministic, I already have seen the following behaviors:
>  * Return the first filter result twice
>  * Null pointer
>  * The following exception:
> {code:java}
> {"httpStatus":"INTERNAL_SERVER_ERROR","exceptionKey":"Exception(org.hibernate.QueryException)","exceptionMessage":"An unhandled exception happened: Not all named parameters have been set: [2] [SELECT E1 FROM PackageDTOMock E1 WHERE (E1.recipientName = ?2)]."}
> {code}
> I have generated the following test code in javascript:
> {code:javascript}
> function prepareData(sUrl){ var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("GET", sUrl); xhr.setRequestHeader("authorization", "Basic YWRtaW46YWRtaW4="); return xhr; }
>  
> a = prepareData("http://localhost:8080/OData/V2/CareCorner.svc/PackageDTOMocks?%24filter=RecipientName%20eq%20'Karl%20Mendel'");
>  
> b = prepareData("http://localhost:8080/OData/V2/CareCorner.svc/PackageDTOMocks?%24filter=RecipientName%20eq%20'John%20Frank'"); 
>  
> a.send(null); 
> b.send(null);
> {code}
> The issue seems to lie on class *JPAQueryBuilder*, method *buildQuery*.
>  The parameter *parameterizedMap* is filled from an static method _getParameterizedQueryMap_().
> {code:java}
>     Map<String, Map<Integer, Object>> parameterizedMap = ODataParameterizedWhereExpressionUtil.
>         getParameterizedQueryMap();
> {code}
>  
> I'm setting this as critical because we are facing this in two different projects and there is no way to release Olingo in an production application with this issue when sending parallel requests.



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