# Connection pooling from Java

**URL:** <https://community.stardog.com/t/connection-pooling-from-java/2188>\
**Category:** Support\
**Created:** [January 10, 2020, 10:14am UTC](https://community.stardog.com/t/connection-pooling-from-java/2188 "2020-01-10T10:14:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![semanticfire](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/semanticfire/32/47_2.png) [@semanticfire](https://community.stardog.com/u/semanticfire)\
**Post date:** [January 10, 2020, 10:14am UTC](https://community.stardog.com/t/connection-pooling-from-java/2188/1 "2020-01-10T10:14:15Z")

</div>

Hi  
We are using the Stardog Java API from Tomee for our applications, currently every transaction taking place in the applications running on Tomee will create a new connection to Stardog ( and close it ).  
I've looked at the pooling documentation but I cannot find a clear benefit from using this in our application. Since Stardog API communicates over HTTP I was wondering if the connections remain open and thus improving performance.  
If you could shed some light on this that would be great, I have 'StardogProvider' resource type available which could be used with pooling in Tomee/Tomcat installation I'm more then happy to share that as OpenSource.

Bart

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [January 24, 2020, 10:14am UTC](https://community.stardog.com/t/connection-pooling-from-java/2188/2 "2020-01-24T10:14:16Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [April 2, 2020, 1:55pm UTC](https://community.stardog.com/t/connection-pooling-from-java/2188/3 "2020-04-02T13:55:09Z")

</div>

We haven't run this through a profiler or anything, but when creating a new Connection, there's a non-negligible amount of client-side processing and configuration that is done (especially when using HTTPS), as well as 2 additional round trips between client and server to establish the connection. On top of that, if many connections are opened in a short time, they may tie up file handlers at the system level. Connection pooling avoids all of these issues.
