[
https://issues.apache.org/jira/browse/OLINGO-1254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Fernando Mendel updated OLINGO-1254:
------------------------------------
Summary: Issue when sending requests in parallel (was: OData Issue when
sending requests in parallel)
> 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:java}
> <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}
>
> One servlet is declared and is working fine:
>
> {code:java}
> @Bean
> public ODataServlet odataServlet() {
> return new ODataServlet();
> }
> @Bean
> public ServletRegistrationBean odataServletRegistrationBean(){
> ServletRegistrationBean servlet = new
> ServletRegistrationBean(odataServlet(),"/OData/V2/CareCorner.svc/*");
> servlet.setLoadOnStartup(3);
> servlet.addInitParameter("javax.ws.rs.Application",
> "org.apache.olingo.odata2.core.rest.app.ODataApplication");
> servlet.addInitParameter("org.apache.olingo.odata2.service.factory",
> jpaFactoryClass);
> return servlet;
> }
> {code}
>
>
> When doing two assyncronous requests to GET data from OData, sometimes it
> works, sometimes it does not.
> I have generated the following test code in javascript:
> {code:java}
> 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'Fernando%20Mendel'");
>
> b =
> prepareData("http://localhost:8080/OData/V2/CareCorner.svc/PackageDTOMocks?%24filter=RecipientName%20eq%20'Rafael%20Frank'");
>
>
> a.send(null);
> b.send(null);
> {code}
>
> it sends two get requests with different filters.
>
> sometimes it returns the appropriate response, which is the response from
> both requests:
> {code:java}
> <?xml version="1.0" encoding="utf-8"?><feed
> xmlns="http://www.w3.org/2005/Atom"
> xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
> xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
> xml:base="http://localhost:8080/OData/V2/CareCorner.svc/"><id>http://localhost:8080/OData/V2/CareCorner.svc/PackageDTOMocks</id><title
>
> type="text">PackageDTOMocks</title><updated>2018-04-03T13:32:31.059Z</updated><author><name></name></author><link
> href="PackageDTOMocks" rel="self"
> title="PackageDTOMocks"></link><entry><id>http://localhost:8080/OData/V2/CareCorner.svc/PackageDTOMocks('794687096865')</id><title
>
> type="text">PackageDTOMocks</title><updated>2018-04-03T13:32:31.059Z</updated><category
> term="LocalPersistenceUnit.PackageDTOMock"
> scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"></category><link
> href="PackageDTOMocks('794687096865')" rel="edit"
> title="PackageDTOMock"></link><content
> type="application/xml"><m:properties><d:AdultSignatureRequired>false</d:AdultSignatureRequired><d:DangerousGood>true</d:DangerousGood><d:RecipientName>Rafael
>
> Frank</d:RecipientName><d:ShippingType>EXPRESS</d:ShippingType><d:TrackingNumber>794687096865</d:TrackingNumber></m:properties></content></entry></feed>
> {code}
>
> and sometimes it generates an error:
> {code:java}
> {"httpStatus":"INTERNAL_SERVER_ERROR","exceptionKey":"SAPException(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'm setting this as critical because 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)