1 Reply Latest reply on Apr 29, 2014 9:45 AM by Jesper Pedersen

    Where to put a custom ConnectionListener?

    Mike Hostetler Newbie

      So I was digging into the code we need to port over, wondering why allow-multiple-user pooling wasn't working, and discovered that we need to run some SQL when the connection is opened and destroyed.


      I found the pool configuration document and it talked about a "connection-listener" tag in the pool configuration. I went around and found some documentation for the ConnectionListener interface in ironjacamar-jdbc and found this post:




      I'm not sure what Jesper meant by "You can link your database module with the module where your implementation is located" and the documentation seemed a bit . . . obtuse.


      This is what my driver pool sections look like:










               <connection-listener class-name="com.foo.jdbc.SqlServerConnectionListener"/>



      What I have tried:


      • Putting my jar with SqlServerConnectionListener as a Wildfly module.
      • Deploying my jar with the ConnectionListener in standalone/deployments (along with my app and the SQLServer driver)
      • Putting Dependencies: myJar.jar in the MANIFEST.MF of my dao jar.


      All of them has resulted in the same error:



      Caused by: java.lang.ClassNotFoundException: com.foo.jdbc.SqlServerConnectionListener from [Module "org.jboss.ironjacamar.jdbcadapters:main" from local module loader...



      What can I do to get IronJacamar/WildFly to see my custom ConnectionListener?