HHH-10178 - Move Geronimo JTA jar to provided configuration (non-transitive)

This commit is contained in:
Steve Ebersole 2015-11-17 10:21:58 -06:00
parent 2cb113cf96
commit 4793ca30a2
12 changed files with 91 additions and 52 deletions

View File

@ -9,6 +9,7 @@ package org.hibernate.c3p0.internal;
import java.sql.SQLException;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.log.ConnectionPoolingLogger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
@ -25,7 +26,7 @@ import static org.jboss.logging.Logger.Level.WARN;
* New messages must be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger(projectCode = "HHH")
public interface C3P0MessageLogger extends CoreMessageLogger {
public interface C3P0MessageLogger extends ConnectionPoolingLogger {
/**
* Log a message (WARN) about conflicting {@code hibernate.c3p0.XYZ} and {@code c3p0.XYZ} settings

View File

@ -16,7 +16,6 @@ dependencies {
compile( libraries.antlr )
compile( libraries.jandex )
compile( libraries.classmate )
compile( libraries.jta )
// We need dom4j for a number of things temporarily:
// 1) (unsupported) EntityMode.DOM4J support
@ -27,9 +26,10 @@ dependencies {
antlr( libraries.antlr )
provided( libraries.ant )
provided( libraries.jta )
provided( libraries.jacc )
provided( libraries.validation )
provided( libraries.ant )
testCompile( project(':hibernate-testing') )
testCompile( libraries.validation )

View File

@ -19,8 +19,7 @@ import org.hibernate.HibernateException;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.log.ConnectionPoolingLogger;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.service.UnknownUnwrapTypeException;
import org.hibernate.service.spi.Configurable;
@ -44,7 +43,7 @@ import org.hibernate.service.spi.Stoppable;
public class DriverManagerConnectionProviderImpl
implements ConnectionProvider, Configurable, Stoppable, ServiceRegistryAwareService {
private static final CoreMessageLogger log = CoreLogging.messageLogger( DriverManagerConnectionProviderImpl.class );
private static final ConnectionPoolingLogger log = ConnectionPoolingLogger.CONNECTIONS_LOGGER;
public static final String MIN_SIZE = "hibernate.connection.min_pool_size";
public static final String INITIAL_SIZE = "hibernate.connection.initial_pool_size";

View File

@ -67,7 +67,7 @@ public interface CoreMessageLogger extends BasicLogger {
void autoCommitMode(boolean autocommit);
@LogMessage(level = WARN)
@Message(value = "JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()",
@Message(value = "JTASessionContext being used with JDBC transactions; auto-flush will not operate correctly with getCurrentSession()",
id = 8)
void autoFlushWillNotWork();
@ -96,10 +96,6 @@ public interface CoreMessageLogger extends BasicLogger {
@Message(value = "Calling joinTransaction() on a non JTA EntityManager", id = 27)
void callingJoinTransactionOnNonJtaEntityManager();
@LogMessage(level = INFO)
@Message(value = "Cleaning up connection pool [%s]", id = 30)
void cleaningUpConnectionPool(String url);
@LogMessage(level = DEBUG)
@Message(value = "Closing", id = 31)
void closing();
@ -160,10 +156,6 @@ public interface CoreMessageLogger extends BasicLogger {
@Message(value = "Configuring from XML document", id = 45)
void configuringFromXmlDocument();
@LogMessage(level = INFO)
@Message(value = "Connection properties: %s", id = 46)
void connectionProperties(Properties connectionProps);
@LogMessage(level = INFO)
@Message(value = "Connections obtained: %s", id = 48)
void connectionsObtained(long connectCount);
@ -483,20 +475,9 @@ public interface CoreMessageLogger extends BasicLogger {
@Message(value = "%s = false breaks the EJB3 specification", id = 144)
void jdbcAutoCommitFalseBreaksEjb3Spec(String autocommit);
@LogMessage(level = WARN)
@Message(value = "No JDBC Driver class was specified by property %s", id = 148)
void jdbcDriverNotSpecified(String driver);
@LogMessage(level = INFO)
@Message(value = "JDBC isolation level: %s", id = 149)
void jdbcIsolationLevel(String isolationLevelToString);
@Message(value = "JDBC rollback failed", id = 151)
String jdbcRollbackFailed();
@Message(value = "JDBC URL was not specified by property %s", id = 152)
String jdbcUrlNotSpecified(String url);
@LogMessage(level = INFO)
@Message(value = "JNDI InitialContext properties:%s", id = 154)
void jndiInitialContextProperties(Hashtable hash);
@ -992,10 +973,6 @@ public interface CoreMessageLogger extends BasicLogger {
@Message(value = "IOException occurred closing output stream", id = 292)
void unableToCloseOutputStream(@Cause IOException e);
@LogMessage(level = WARN)
@Message(value = "Problem closing pooled connection", id = 293)
void unableToClosePooledConnection(@Cause SQLException e);
@LogMessage(level = ERROR)
@Message(value = "Could not close session", id = 294)
void unableToCloseSession(@Cause HibernateException e);
@ -1437,16 +1414,6 @@ public interface CoreMessageLogger extends BasicLogger {
@Message(value = "Using dialect: %s", id = 400)
void usingDialect(Dialect dialect);
@LogMessage(level = INFO)
@Message(value = "using driver [%s] at URL [%s]", id = 401)
void usingDriver(
String driverClassName,
String url);
@LogMessage(level = WARN)
@Message(value = "Using Hibernate built-in connection pool (not for production use!)", id = 402)
void usingHibernateBuiltInConnectionPool();
@LogMessage(level = ERROR)
@Message(value = "Don't use old DTDs, read the Hibernate 3.x Migration Guide!", id = 404)
void usingOldDtd();

View File

@ -0,0 +1,71 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.internal.log;
import java.sql.SQLException;
import java.util.Properties;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;
/**
* @author Steve Ebersole
*/
@MessageLogger( projectCode = "HHH" )
@ValidIdRange( min = 10001001, max = 10001500 )
public interface ConnectionPoolingLogger extends BasicLogger {
/**
* Static access to the logging instance
*/
public static final ConnectionPoolingLogger CONNECTIONS_LOGGER = Logger.getMessageLogger(
ConnectionPoolingLogger.class,
"org.hibernate.orm.connections"
);
@LogMessage(level = INFO)
@Message(value = "Connection properties: %s", id = 10001001)
void connectionProperties(Properties connectionProps);
@LogMessage(level = WARN)
@Message(value = "Using Hibernate built-in connection pool (not for production use!)", id = 10001002)
void usingHibernateBuiltInConnectionPool();
@LogMessage(level = INFO)
@Message(value = "Autocommit mode: %s", id = 10001003)
void autoCommitMode(boolean autocommit);
@Message(value = "JDBC URL was not specified by property %s", id = 10001004)
String jdbcUrlNotSpecified(String url);
@LogMessage(level = INFO)
@Message(value = "using driver [%s] at URL [%s]", id = 10001005)
void usingDriver(String driverClassName, String url);
@LogMessage(level = WARN)
@Message(value = "No JDBC Driver class was specified by property %s", id = 10001006)
void jdbcDriverNotSpecified(String driver);
@LogMessage(level = INFO)
@Message(value = "JDBC isolation level: %s", id = 10001007)
void jdbcIsolationLevel(String isolationLevelToString);
@LogMessage(level = INFO)
@Message(value = "Cleaning up connection pool [%s]", id = 10001008)
void cleaningUpConnectionPool(String url);
@LogMessage(level = WARN)
@Message(value = "Problem closing pooled connection", id = 10001009)
void unableToClosePooledConnection(@Cause SQLException e);
}

View File

@ -7,6 +7,7 @@
dependencies {
compile project( ':hibernate-core' )
compile( libraries.ehcache )
provided( libraries.jta )
testCompile project( ':hibernate-testing' )
}

View File

@ -22,9 +22,10 @@ dependencies {
compile( libraries.dom4j )
compile( libraries.commons_annotations )
compile( libraries.jpa )
compile( libraries.jta )
compile( libraries.javassist )
provided( libraries.jta )
provided( "javax.enterprise:cdi-api:1.1-PFD" )
testCompile( project(':hibernate-testing') )

View File

@ -10,6 +10,8 @@ dependencies {
compile( project( ':hibernate-core' ) )
compile( project( ':hibernate-entitymanager' ) )
provided( libraries.jta )
provided( [group: 'org.hibernate', name: 'hibernate-tools', version: '3.2.0.ga'] )
provided( libraries.ant )
provided( project( ':hibernate-jpamodelgen' ) )

View File

@ -18,6 +18,8 @@ dependencies {
compile( libraries.infinispan )
compile( libraries.rhq )
provided( libraries.jta )
testCompile project( ':hibernate-testing' )
testCompile( libraries.infinispan_test )
testCompile( libraries.jboss_common_core )

View File

@ -44,6 +44,7 @@ dependencies {
compile( project( ':hibernate-core' ) )
compile( project( ':hibernate-entitymanager' ) )
compile( libraries.jta )
// MUST use 4.3.1! 4.3.0 was compiled with "-target jsr14".
// http://blog.osgi.org/2012/10/43-companion-code-for-java-7.html

View File

@ -193,7 +193,7 @@ public class ProxoolConnectionProvider
LOG.jdbcIsolationLevel( ConnectionProviderInitiator.toIsolationNiceName( isolation ) );
autocommit = ConfigurationHelper.getBoolean( Environment.AUTOCOMMIT, props );
LOG.autoCommmitMode( autocommit );
LOG.autoCommitMode( autocommit );
}
private Reader getConfigStreamReader(String resource) {

View File

@ -7,10 +7,12 @@
package org.hibernate.proxool.internal;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.log.ConnectionPoolingLogger;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.logging.annotations.ValidIdRange;
import static org.jboss.logging.Logger.Level.INFO;
@ -21,16 +23,8 @@ import static org.jboss.logging.Logger.Level.INFO;
* New messages must be added after the last message defined to ensure message codes are unique.
*/
@MessageLogger(projectCode = "HHH")
public interface ProxoolMessageLogger extends CoreMessageLogger {
/**
* Logs the autocommit mode to be used for pooled connections
*
* @param autocommit The autocommit mode
*/
@LogMessage(level = INFO)
@Message(value = "Autocommit mode: %s", id = 30001)
void autoCommmitMode(boolean autocommit);
@ValidIdRange( min = 30001, max = 35000 )
public interface ProxoolMessageLogger extends ConnectionPoolingLogger {
/**
* Logs the name of a named pool to be used for configuration information