Invalid use of SingleClientConnManager: connection still allocated Exception

275 views
Skip to first unread message

Stephane Fellah

unread,
Jun 24, 2011, 4:33:42 PM6/24/11
to Stardog
I have the following exception thrown when I try to list all subjects
and then print the object in N3 formats (2 nested queries). I try to
use the same connection for all my queries.

Exception in thread "main" java.lang.IllegalStateException: Invalid
use of SingleClientConnManager: connection still allocated.
Make sure to release the connection before allocating another one.
at
org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:
216)
at org.apache.http.impl.conn.SingleClientConnManager
$1.getConnection(SingleClientConnManager.java:190)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
391)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
820)
at com.clarkparsia.stardog.api.http.a.a(Unknown Source)
at com.clarkparsia.stardog.api.http.a.a(Unknown Source)
at com.clarkparsia.stardog.api.http.b.executeGraph(Unknown Source)
at com.clarkparsia.stardog.api.impl.GetterImpl.iterator(Unknown
Source)
at com.clarkparsia.stardog.api.impl.GetterImpl.iterator(Unknown
Source)
at
com.knowledgesmarts.repository.stardog.graph.StardogGraph.findImpl(StardogGraph.java:
41)
at
com.knowledgesmarts.core.graph.impl.AbstractGraph.find(AbstractGraph.java:
680)

Any clue ?
Thanks
Stephane Fellah

Mike Grove

unread,
Jun 27, 2011, 9:47:43 AM6/27/11
to Stephane Fellah, Stardog
Yes, this is a bug. We use the default http client implementation for
the Apache HTTP lib, which internally defaults to a singleton pattern
for the connections. So you cannot open another connection while you
still have one open. For v0.6.1 we'll change internally over to the
multi-threaded connection manager which will resolve this issue. But
you will have to be even more careful wrt to closing result sets as if
you don't and you use up Apache's connection pool, the behavior is to
block until a connection becomes free.

So we'll have this fixed for next week; it's in fact fixed now, but
too late to make it into 0.6.

Thanks for reporting this.

Cheers,

Mike

> --
> You received this message because you are subscribed to the C&P "Stardog" group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
>

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages