These are chat archives for OfficeDev/ews-java-api

22nd
Jun 2015
elarbi
@elarbi
Jun 22 2015 09:51
Hi, I'm trying to reuse a service to access different folder but I get an Exception:
        FolderId folderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox(email));
        CalendarFolder cf = CalendarFolder.bind(service, folderId);
        findResults = cf.findAppointments(new CalendarView(startDate, endDate));
When I call the CalendarFolder.bind method I get : microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException: The request failed. Connection is still allocated
Erik van Paassen
@evpaassen
Jun 22 2015 09:52
Are you reusing the service in multiple threads?
elarbi
@elarbi
Jun 22 2015 09:55
I'm in a JEE context (JBoss 5) and yes it uses different threads
Erik van Paassen
@evpaassen
Jun 22 2015 09:56
The ExchangeService is not thread-safe, so you'll have to create one service per thread.
elarbi
@elarbi
Jun 22 2015 09:56
Ok, thanks
Vladislav Bauer
@vbauer
Jun 22 2015 11:19
I think it will be useful to add this information in javadoc.
elarbi
@elarbi
Jun 22 2015 14:13
+1 :)