Giter Site home page Giter Site logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
Indeed, a way to solve your issue could be to create a "XADataSourceSpy", and 
also a "XAConnectionSpy", but the problem is: should we provide support only 
for the method "PooledConnection#getConnection()" (that could be wrapped easily 
by a ConnectionSpy)? I don't really see the point for a XA resource. 

Providing a full support for XADataSources would be a completely new branch of 
log4jdbc, we would need to create "ConnectionEventListenerSpy", 
"StatementEventListenerSpy", "XAResourceSpy", etc. 

If you wanted to provide such a patch, I could consider it. 

Original comment by [email protected] on 21 Mar 2014 at 12:34

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from log4jdbc-log4j2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
[deleted comment]

from log4jdbc-log4j2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
As a workaround, I've also found that my JTA transaction manager (Atomikos) has 
a datasource bean that can be used to wrap the XA datasources and thus provide 
the regular datasource interface that can be further wrapped by DataSourceSpy.  
e.g.:

    <!-- Atomikos's XA capable pooling data source. -->
    <bean id="myJTADataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean">
        <property name="xaDataSource" ref="myh2XaDataSource" />
        <property name="uniqueResourceName" value="myDatabase" />
                ...
    </bean>

    <!-- Special logging wrapper for our data source that spys on JDBC calls -->
    <bean id="myJTADataSourceSpied" class="net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy">
        <constructor-arg ref="myJTADataSource" />
    </bean>

I have to believe this approach is readily available for almost any JTA 
transaction manager that uses XA data sources.  IMO you can close this issue as 
won't fix because, as you said, its a lot of work to support XA natively and 
I'm not convinced now that there would be any benefit.

Original comment by [email protected] on 24 Mar 2014 at 2:37

from log4jdbc-log4j2.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
Thanks for the update. Won't fix :)

Original comment by [email protected] on 25 Mar 2014 at 1:47

  • Changed state: WontFix

from log4jdbc-log4j2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.