Class JtaAwareConnectionProviderImpl

java.lang.Object
org.hibernate.testing.jta.JtaAwareConnectionProviderImpl
All Implemented Interfaces:
Serializable, org.hibernate.engine.jdbc.connections.spi.ConnectionProvider, org.hibernate.service.Service, org.hibernate.service.spi.Configurable, org.hibernate.service.spi.ServiceRegistryAwareService, org.hibernate.service.spi.Stoppable, org.hibernate.service.spi.Wrapped

public class JtaAwareConnectionProviderImpl extends Object implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider, org.hibernate.service.spi.Configurable, org.hibernate.service.spi.Stoppable, org.hibernate.service.spi.ServiceRegistryAwareService
A ConnectionProvider implementation intended for testing Hibernate/JTA interaction. In that limited scope we only ever have one single resource (the database connection) so we do not at all care about full-blown XA semantics. This class behaves accordingly. This class also assumes usage of and access to JBossTS/Arjuna.
See Also:
  • Constructor Details

    • JtaAwareConnectionProviderImpl

      public JtaAwareConnectionProviderImpl()
  • Method Details

    • injectServices

      public void injectServices(org.hibernate.service.spi.ServiceRegistryImplementor serviceRegistry)
      Specified by:
      injectServices in interface org.hibernate.service.spi.ServiceRegistryAwareService
    • configure

      public void configure(Map<String,Object> configurationValues)
      Specified by:
      configure in interface org.hibernate.service.spi.Configurable
    • stop

      public void stop()
      Specified by:
      stop in interface org.hibernate.service.spi.Stoppable
    • getConnection

      public Connection getConnection() throws SQLException
      Specified by:
      getConnection in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
      Throws:
      SQLException
    • closeConnection

      public void closeConnection(Connection connection) throws SQLException
      Specified by:
      closeConnection in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
      Throws:
      SQLException
    • supportsAggressiveRelease

      public boolean supportsAggressiveRelease()
      Specified by:
      supportsAggressiveRelease in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
    • getDatabaseConnectionInfo

      public org.hibernate.engine.jdbc.connections.spi.DatabaseConnectionInfo getDatabaseConnectionInfo(org.hibernate.dialect.Dialect dialect)
      Specified by:
      getDatabaseConnectionInfo in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
    • getDatabaseConnectionInfo

      public org.hibernate.engine.jdbc.connections.spi.DatabaseConnectionInfo getDatabaseConnectionInfo(org.hibernate.dialect.Dialect dialect, org.hibernate.engine.jdbc.env.spi.ExtractedDatabaseMetaData metaData)
      Specified by:
      getDatabaseConnectionInfo in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
    • findCurrentTransaction

      protected Transaction findCurrentTransaction()
    • isUnwrappableAs

      public boolean isUnwrappableAs(Class<?> unwrapType)
      Specified by:
      isUnwrappableAs in interface org.hibernate.service.spi.Wrapped
    • unwrap

      public <T> T unwrap(Class<T> unwrapType)
      Specified by:
      unwrap in interface org.hibernate.service.spi.Wrapped