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

Florian Müller commented on CMIS-474:
-------------------------------------

The HttpURLConnection implementation is in charge of closing connections 
because it handles the keep-alive logic. Closing connections manually can have 
a significant performance impact and is not recommended. 
                
> HttpURLConnection do not close
> ------------------------------
>
>                 Key: CMIS-474
>                 URL: https://issues.apache.org/jira/browse/CMIS-474
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client-bindings
>    Affects Versions: OpenCMIS 0.5.0
>            Reporter: Marco Spasiano
>            Priority: Critical
>              Labels: patch
>             Fix For: OpenCMIS 0.5.0
>
>
> If execute this code i got an error.
>               Session session = getCMISSession();
>               try{
>                       Folder folder = (Folder) session.getObjectByPath("/");  
>                 
>                       for (int i = 0; i < 100; i++) {
>                               System.out.println("before create folder");
>                               Folder newFolder = createNewFolder(folder, 
> "TEST HTTPCONNECTION CLOSE");
>                               System.out.println("after create folder");
>                               newFolder.delete(true);
>                               System.out.println("after delete folder");      
>                         
>                       }
>               }catch (CmisBaseException e) {
>                       e.printStackTrace();
>                       System.err.println(e.getErrorContent());
>               }               
> Maybe because in 
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.HttpUtils after 
> open connection
> don't close the connection.
>             HttpURLConnection conn = (HttpURLConnection) (new 
> URL(url.toString())).openConnection();
> if I add this code everythings work fine.
>               conn.setRequestProperty("connection", "close");

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to