|
From: Ron S. <rs...@re...> - 2013-02-19 21:30:55
|
This isn't an issue, just an observation. I had a test that looked like
ClientRequest request = new
ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/concrete/decorators/clear");
ClientResponse<?> response = request.get();
assertEquals(200, response.getStatus());
request = new
ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/concrete/decorators/execute");
response = request.get();
which I rewrote as
WebTarget target =
ClientBuilder.newClient().target("http://localhost:8080/resteasy-cdi-ejb-test/rest/concrete/decorators");
Response response = target.path("clear").request().get();
assertEquals(200, response.getStatus());
response = target.path("execute").request().get();
The latter failed with
Caused by: java.lang.IllegalStateException: Invalid use of
SingleClientConnManager: connection still allocated.
Make sure to release the connection before allocating another one.
because I didn't call Response.close(). The analogous call
(ClientResponse.releaseConnection) wasn't necessary in the original
version (though I probably should have done it anyway) because I created
a new ClientRequest for the second call.
The point is that the client framework encourages factoring and reuse,
which led to a problem I didn't have before. Or, really, it exposed a
problem I had before without realizing it.
That's all. Just saying.
-Ron
On 02/18/2013 03:14 PM, Ron Sigal wrote:
> Cool. Done: RESTEASY-829 "CDI doesn't work in client framework".
>
> On 02/17/2013 07:43 PM, Bill Burke wrote:
>> Currently I create a brand new ResteasyProviderFactory every time you
>> create a Client. This has been done for classloader reasons and because
>> you're not really supposed to initialize a Client with scanned providers.
>
> ------------------------------------------------------------------------------
> The Go Parallel Website, sponsored by Intel - in partnership with Geeknet,
> is your hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials, tech docs,
> whitepapers, evaluation guides, and opinion stories. Check out the most
> recent posts - join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
|