[
https://issues.apache.org/jira/browse/OLINGO-999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15473727#comment-15473727
]
Christian Amend commented on OLINGO-999:
----------------------------------------
[[email protected]] I did not implement this part of the Olingo
library and I am also not familiar with the reason why a Piped...Stream is used
to read and write.
In my opinion if you would change this to something else e.g.
BufferedInputStream and all tests are running fine I would be OK with the
change. Or if you could make it configurable what kind of stream a user wants
the solution would be even better.
I can understand that this is a blocker for your use case but unfortunately I
am pretty blocked right now with other work and won`t have a lot of spare time
to look at this. Maybe if you start a discussion about this topic on the Olingo
user mailing list you can get feedback from other client users.
Best Regards,
Christian
> Cannot add more than one request into ChangSet - thread halts in infinite loop
> ------------------------------------------------------------------------------
>
> Key: OLINGO-999
> URL: https://issues.apache.org/jira/browse/OLINGO-999
> Project: Olingo
> Issue Type: Bug
> Components: odata4-client, odata4-commons
> Affects Versions: (Java) V4 4.2.0
> Reporter: Punith DG
> Priority: Blocker
> Labels: batch, changeset, thread-safety
> Attachments: $metadata.xml, BatchTest.java, blocking1.png,
> blocking2.png
>
>
> I am not able to add more than one request to a batch ChangeSet as the
> BatchManager has PipedOutputStream Writer that's causing thread to get into
> infinite loop.
> Check the below sample code in which I'm trying to add requests.
> for loop{
> ODataBatchRequest batchRequest =
> client.getBatchRequestFactory().getBatchRequest("serviceRootURI");
> BatchManager payloadManager = batchRequest.payloadManager();
> ODataChangeset changeset = payloadManager.addChangeset();
> ODataEntityCreateRequest<ClientEntity> createRequest =
> client.getCUDRequestFactory()
>
> .getEntityCreateRequest(new URI("serviceRoot"), clientEntity);
> createRequest.setFormat(ContentType.JSON);
> changeset.addRequest(createRequest); // here the thread waits in infinite
> loop due to piped streams sync problem.
> }
> The problem is observed in line "request.batch(req,
> String.valueOf(contentId));" in addRequest() method of ODataChangesetImpl
> class.
> It seems a known issue in Java -
> http://stackoverflow.com/questions/9171632/piped-input-stream-is-getting-locked
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)