Re: Getting all JDBC configs from the context

2018-04-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shawn, On 3/30/18 5:30 PM, Shawn Heisey wrote: > On 3/30/2018 11:38 AM, Christopher Schultz wrote: >> No. In Java, the "class" is defined by the ClassLoader (which >> loaded it) plus the fully-qualified class name. It's entirely >> possible in > >

Re: Getting all JDBC configs from the context

2018-03-30 Thread Shawn Heisey
On 3/30/2018 11:38 AM, Christopher Schultz wrote: > No. In Java, the "class" is defined by the ClassLoader (which loaded > it) plus the fully-qualified class name. It's entirely possible in The subtleties of classloader-related problems make my head hurt. :) > If objects a and b were

Re: Getting all JDBC configs from the context

2018-03-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shawn, On 3/29/18 3:29 PM, Shawn Heisey wrote: > On 3/29/2018 10:00 AM, Christopher Schultz wrote: >> I don't bother with any of that garbage. I use Tomcat's Manager >> application and the JMXProxyServlet. It's an HTTP-to-JMX bridge, >> so your

Re: Getting all JDBC configs from the context

2018-03-29 Thread Shawn Heisey
On 3/29/2018 10:00 AM, Christopher Schultz wrote: > I don't bother with any of that garbage. I use Tomcat's Manager > application and the JMXProxyServlet. It's an HTTP-to-JMX bridge, so > your client just has to speak HTTP. I'm not sure that the manager application is active on our install.  The

Re: Getting all JDBC configs from the context

2018-03-29 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shawn, On 3/29/18 12:00 PM, Christopher Schultz wrote: > Shawn, > > On 3/28/18 4:42 PM, Shawn Heisey wrote: >> On 3/28/2018 1:18 PM, Christopher Schultz wrote: I would like to write a logging thread that can get ALL of the datasource

Re: Getting all JDBC configs from the context

2018-03-29 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shawn, On 3/28/18 4:42 PM, Shawn Heisey wrote: > On 3/28/2018 1:18 PM, Christopher Schultz wrote: >>> I would like to write a logging thread that can get ALL of the >>> datasource objects from the context, and for types that it >>> knows, cast

Re: Getting all JDBC configs from the context

2018-03-29 Thread Shawn Heisey
On 3/28/2018 1:18 PM, Christopher Schultz wrote: Don't forget to terminate the thread (or ExecutorService) when the application is shutting-down, of you'll have a ClassLoader (and a a huge memory) leak. Here's a new paste, that I think addresses the thread leak problem.

Re: Getting all JDBC configs from the context

2018-03-28 Thread Shawn Heisey
On 3/28/2018 1:18 PM, Christopher Schultz wrote: > > I would like to write a logging thread that can get ALL of the > > datasource objects from the context, and for types that it knows, > > cast them to the appropriate object to log the active/idle > > connection counts. > > It might be easier to

Re: Getting all JDBC configs from the context

2018-03-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Shawn, On 3/27/18 10:26 PM, Shawn Heisey wrote: > This is what the code in our application looks like that gets a > datasource object from the context: > > Context initContext = new InitialContext(); Context envContext = >

Getting all JDBC configs from the context

2018-03-27 Thread Shawn Heisey
This is what the code in our application looks like that gets a datasource object from the context:   Context initContext = new InitialContext();   Context envContext  = (Context)initContext.lookup("java:/comp/env");   DataSource ds = (DataSource)envContext.lookup("jdbc/REDACTED"); I would like