You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Rohit Jhunjhunwala <ro...@gmail.com> on 2014/02/18 18:04:28 UTC

Number of connection to an embedded derby database

Hi,

I am using an embedded derby database (Apache Derby 10.8.1.2) in my java
desktop application.
I would like to know that is there any way to monitor the number of active
connections from my desktop application to the derby database.

I understand that embedded derby db does not allows connection from
multiple JVM; still for the sake of completeness, are there any special
tools which will publish connection stats while my application is active.

I have used *EmbeddedConnectionPoolDataSource *class for connection pooling
and I just want to check if my connection are actually being pooled.


Thanks,
Rohit Jhunjhunwala

Re: Number of connection to an embedded derby database

Posted by Rick Hillegas <ri...@oracle.com>.
On 2/18/14 9:04 AM, Rohit Jhunjhunwala wrote:
> Hi,
>
> I am using an embedded derby database (Apache Derby 10.8.1.2) in my 
> java desktop application.
> I would like to know that is there any way to monitor the number of 
> active connections from my desktop application to the derby database.
>
> I understand that embedded derby db does not allows connection from 
> multiple JVM; still for the sake of completeness, are there any 
> special tools which will publish connection stats while my application 
> is active.
>
> I have used *EmbeddedConnectionPoolDataSource *class for connection 
> pooling and I just want to check if my connection are actually being 
> pooled.
>
>
> Thanks,
> Rohit Jhunjhunwala
Hi Rohit,

Derby does not provide an api for retrieving this useful information. I 
have added it to the list of database behaviors which users would like 
to track: https://issues.apache.org/jira/browse/DERBY-5772

The issue has come up before. It's possible that someone has a tool or 
workaround which they could share.

Thanks,
-Rick

Re: Number of connection to an embedded derby database

Posted by Bryan Pendleton <bp...@gmail.com>.
> I have used *EmbeddedConnectionPoolDataSource *class for connection pooling and I just want to check if my connection are actually being pooled.

You could attach a memory debugger, like the Eclipse Heap
Analysis Tool, and look at the histogram of classes, and
look at the number of instances of the classes in question.

For example, you could look for N instances of your high-level
connection class, and expect to see K instances of the lower-level
Derby connection class, where K is the number that you configured
into your pool.

thanks,

bryan