-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: possiblility of extending Hibernate's ConnectionProvider
PostPosted: Tue Feb 24, 2004 10:41 pm 
Regular
Regular

Joined: Mon Nov 24, 2003 6:36 pm
Posts: 105
Hi,

I'm interested in using C3PO, or DBCP with HIbernate. I find JNDI to be more trouble that it is worth when trying to run unit tests. At this point, most of the projects I work on are routing all access to db connections through hibernate, providing an easy way to change our configuration from unit testing with local jdbc connections, to JNDI, or other source at runtime. Okay, so here's what I'm wondering.

If I allow Hibernate to set-up the connection pool using c3po, or dbcp, is there some way i can get access to a handle to the connection pool. I would like an admin page where I can display #of available connections, in use, etc.
In other words, from the dbcp sample code, i'd like to be able to issue statements like these

System.out.println("NumActive: " + connectionPool.getNumActive());
System.out.println("NumIdle: " + connectionPool.getNumIdle());

One solution I see, is potentially adding methods to connection provider that allow access to the underlying pool after a cast...
Of course, I could pass Hib the conenction whenever I open a session, and create the pool on my own, but that seems like a bunch of work.

Thanks!
James


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.