HHH-5615 Converted logging framework from slf4j to jboss logging for a few class that fell through the cracks

This commit is contained in:
JPAV 2011-03-09 14:58:22 -06:00
parent 4b130da83e
commit 97a310d26d
13 changed files with 176 additions and 162 deletions

View File

@ -1260,7 +1260,7 @@ public interface HibernateLogger extends BasicLogger {
void unableToCloseInitialContext( String string ); void unableToCloseInitialContext( String string );
@LogMessage( level = ERROR ) @LogMessage( level = ERROR )
@Message( value = "Error closing imput files: %s", id = 286 ) @Message( value = "Error closing input files: %s", id = 286 )
void unableToCloseInputFiles( String name, void unableToCloseInputFiles( String name,
@Cause IOException e ); @Cause IOException e );
@ -1814,4 +1814,44 @@ public interface HibernateLogger extends BasicLogger {
String valueOf, String valueOf,
String name2, String name2,
String valueOf2 ); String valueOf2 );
@LogMessage( level = WARN )
@Message( value = "Closing un-released batch", id = 420 )
void closingUnreleasedBatch();
@LogMessage( level = INFO )
@Message( value = "Disabling contextual LOB creation as %s is true", id = 421 )
void disablingContextualLOBCreation( String nonContextualLobCreation );
@LogMessage( level = INFO )
@Message( value = "Disabling contextual LOB creation as connection was null", id = 422 )
void disablingContextualLOBCreationSinceConnectionNull();
@LogMessage( level = INFO )
@Message( value = "Disabling contextual LOB creation as JDBC driver reported JDBC version [%s] less than 4", id = 423 )
void disablingContextualLOBCreationSinceOldJdbcVersion( int jdbcMajorVersion );
@LogMessage( level = INFO )
@Message( value = "Disabling contextual LOB creation as createClob() method threw error : %s", id = 424 )
void disablingContextualLOBCreationSinceCreateClobFailed( Throwable t );
@LogMessage( level = INFO )
@Message( value = "Could not close session; swallowing exception as transaction completed", id = 425 )
void unableToCloseSessionButSwallowingError( HibernateException e );
@LogMessage( level = WARN )
@Message( value = "You should set hibernate.transaction.manager_lookup_class if cache is enabled", id = 426 )
void setManagerLookupClass();
@LogMessage( level = WARN )
@Message( value = "Using deprecated %s strategy [%s], use newer %s strategy instead [%s]", id = 427 )
void deprecatedTransactionManagerStrategy( String name,
String transactionManagerStrategy,
String name2,
String jtaPlatform );
@LogMessage( level = INFO )
@Message( value = "Encountered legacy TransactionManagerLookup specified; convert to newer %s contract specified via %s setting", id = 428 )
void legacyTransactionManagerStrategy( String name,
String jtaPlatform );
} }

View File

@ -23,7 +23,13 @@
*/ */
package org.hibernate.engine.jdbc.internal; package org.hibernate.engine.jdbc.internal;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.SQLException;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.engine.SessionFactoryImplementor; import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.jdbc.batch.spi.Batch; import org.hibernate.engine.jdbc.batch.spi.Batch;
import org.hibernate.engine.jdbc.batch.spi.BatchBuilder; import org.hibernate.engine.jdbc.batch.spi.BatchBuilder;
@ -38,14 +44,7 @@ import org.hibernate.engine.transaction.spi.TransactionCoordinator;
import org.hibernate.engine.transaction.spi.TransactionEnvironment; import org.hibernate.engine.transaction.spi.TransactionEnvironment;
import org.hibernate.jdbc.ReturningWork; import org.hibernate.jdbc.ReturningWork;
import org.hibernate.jdbc.Work; import org.hibernate.jdbc.Work;
import org.slf4j.Logger; import org.jboss.logging.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.SQLException;
/** /**
* Standard Hibernate implementation of {@link JdbcCoordinator} * Standard Hibernate implementation of {@link JdbcCoordinator}
@ -55,7 +54,8 @@ import java.sql.SQLException;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class JdbcCoordinatorImpl implements JdbcCoordinator { public class JdbcCoordinatorImpl implements JdbcCoordinator {
private static final Logger log = LoggerFactory.getLogger( JdbcCoordinatorImpl.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JdbcCoordinatorImpl.class.getName());
private transient TransactionCoordinatorImpl transactionCoordinator; private transient TransactionCoordinatorImpl transactionCoordinator;
@ -129,7 +129,7 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
@Override @Override
public Connection close() { public Connection close() {
if ( currentBatch != null ) { if ( currentBatch != null ) {
log.warn( "Closing un-released batch" ); LOG.closingUnreleasedBatch();
currentBatch.release(); currentBatch.release();
} }
return logicalConnection.close(); return logicalConnection.close();
@ -200,7 +200,7 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
} }
} }
catch (SQLException e) { catch (SQLException e) {
log.debug( "Error closing connection proxy", e ); LOG.debug("Error closing connection proxy", e);
} }
} }
} }
@ -223,7 +223,7 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
} }
} }
catch (SQLException e) { catch (SQLException e) {
log.debug( "Error closing connection proxy", e ); LOG.debug("Error closing connection proxy", e);
} }
} }
} }

View File

@ -23,21 +23,19 @@
*/ */
package org.hibernate.engine.jdbc.internal; package org.hibernate.engine.jdbc.internal;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.DatabaseMetaData;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.Map; import java.util.Map;
import org.hibernate.HibernateLogger;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.engine.jdbc.ContextualLobCreator; import org.hibernate.engine.jdbc.ContextualLobCreator;
import org.hibernate.engine.jdbc.LobCreationContext; import org.hibernate.engine.jdbc.LobCreationContext;
import org.hibernate.engine.jdbc.LobCreator; import org.hibernate.engine.jdbc.LobCreator;
import org.hibernate.engine.jdbc.NonContextualLobCreator; import org.hibernate.engine.jdbc.NonContextualLobCreator;
import org.hibernate.internal.util.config.ConfigurationHelper; import org.hibernate.internal.util.config.ConfigurationHelper;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Builds {@link LobCreator} instances based on the capabilities of the environment. * Builds {@link LobCreator} instances based on the capabilities of the environment.
@ -45,8 +43,10 @@ import org.slf4j.LoggerFactory;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class LobCreatorBuilder { public class LobCreatorBuilder {
private static final Logger log = LoggerFactory.getLogger( LobCreatorBuilder.class );
private boolean useContextualLobCreation; private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, LobCreatorBuilder.class.getName());
private boolean useContextualLobCreation;
/** /**
* The public factory method for obtaining the appropriate (according to given JDBC {@link java.sql.Connection}. * The public factory method for obtaining the appropriate (according to given JDBC {@link java.sql.Connection}.
@ -76,11 +76,11 @@ public class LobCreatorBuilder {
boolean isNonContextualLobCreationRequired = boolean isNonContextualLobCreationRequired =
ConfigurationHelper.getBoolean( Environment.NON_CONTEXTUAL_LOB_CREATION, configValues ); ConfigurationHelper.getBoolean( Environment.NON_CONTEXTUAL_LOB_CREATION, configValues );
if ( isNonContextualLobCreationRequired ) { if ( isNonContextualLobCreationRequired ) {
log.info( "Disabling contextual LOB creation as " + Environment.NON_CONTEXTUAL_LOB_CREATION + " is true" ); LOG.disablingContextualLOBCreation(Environment.NON_CONTEXTUAL_LOB_CREATION);
return false; return false;
} }
if ( jdbcConnection == null ) { if ( jdbcConnection == null ) {
log.info( "Disabling contextual LOB creation as connection was null" ); LOG.disablingContextualLOBCreationSinceConnectionNull();
return false; return false;
} }
@ -89,10 +89,7 @@ public class LobCreatorBuilder {
DatabaseMetaData meta = jdbcConnection.getMetaData(); DatabaseMetaData meta = jdbcConnection.getMetaData();
// if the jdbc driver version is less than 4, it shouldn't have createClob // if the jdbc driver version is less than 4, it shouldn't have createClob
if ( meta.getJDBCMajorVersion() < 4 ) { if ( meta.getJDBCMajorVersion() < 4 ) {
log.info( LOG.disablingContextualLOBCreationSinceOldJdbcVersion(meta.getJDBCMajorVersion());
"Disabling contextual LOB creation as JDBC driver reported JDBC version [" +
meta.getJDBCMajorVersion() + "] less than 4"
);
return false; return false;
} }
} }
@ -113,12 +110,12 @@ public class LobCreatorBuilder {
freeMethod.invoke( clob, NO_ARGS ); freeMethod.invoke( clob, NO_ARGS );
} }
catch ( Throwable ignore ) { catch ( Throwable ignore ) {
log.trace( "Unable to free CLOB created to test createClob() implementation : " + ignore ); LOG.tracef("Unable to free CLOB created to test createClob() implementation : %s", ignore);
} }
return true; return true;
} }
catch ( Throwable t ) { catch ( Throwable t ) {
log.info( "Disabling contextual LOB creation as createClob() method threw error : " + t ); LOG.disablingContextualLOBCreationSinceCreateClobFailed(t);
} }
} }
} }

View File

@ -24,11 +24,8 @@
package org.hibernate.engine.transaction.internal; package org.hibernate.engine.transaction.internal;
import java.util.Map; import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory; import org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory;
import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory; import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory;
@ -37,6 +34,7 @@ import org.hibernate.engine.transaction.spi.TransactionFactory;
import org.hibernate.service.classloading.spi.ClassLoaderService; import org.hibernate.service.classloading.spi.ClassLoaderService;
import org.hibernate.service.spi.ServiceInitiator; import org.hibernate.service.spi.ServiceInitiator;
import org.hibernate.service.spi.ServiceRegistry; import org.hibernate.service.spi.ServiceRegistry;
import org.jboss.logging.Logger;
/** /**
* Standard instantiator for the standard {@link TransactionFactory} service. * Standard instantiator for the standard {@link TransactionFactory} service.
@ -44,7 +42,9 @@ import org.hibernate.service.spi.ServiceRegistry;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class TransactionFactoryInitiator implements ServiceInitiator<TransactionFactory> { public class TransactionFactoryInitiator implements ServiceInitiator<TransactionFactory> {
private static final Logger log = LoggerFactory.getLogger( TransactionFactoryInitiator.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
TransactionFactoryInitiator.class.getName());
public static final TransactionFactoryInitiator INSTANCE = new TransactionFactoryInitiator(); public static final TransactionFactoryInitiator INSTANCE = new TransactionFactoryInitiator();
@ -61,12 +61,12 @@ public class TransactionFactoryInitiator implements ServiceInitiator<Transaction
} }
if ( strategy == null ) { if ( strategy == null ) {
log.info( "Using default transaction strategy (direct JDBC transactions)" ); LOG.usingDefaultTransactionStrategy();
return new JdbcTransactionFactory(); return new JdbcTransactionFactory();
} }
final String strategyClassName = mapLegacyNames( strategy.toString() ); final String strategyClassName = mapLegacyNames( strategy.toString() );
log.info( "Transaction strategy: " + strategyClassName ); LOG.transactionStrategy(strategyClassName);
ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class ); ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
try { try {

View File

@ -23,20 +23,17 @@
*/ */
package org.hibernate.engine.transaction.internal.jdbc; package org.hibernate.engine.transaction.internal.jdbc;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.engine.transaction.spi.IsolationDelegate; import org.hibernate.engine.transaction.spi.IsolationDelegate;
import org.hibernate.engine.transaction.spi.TransactionCoordinator; import org.hibernate.engine.transaction.spi.TransactionCoordinator;
import org.hibernate.jdbc.ReturningWork; import org.hibernate.jdbc.ReturningWork;
import org.hibernate.jdbc.Work; import org.hibernate.jdbc.Work;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.jboss.logging.Logger;
/** /**
* The isolation delegate for JDBC {@link Connection} based transactions * The isolation delegate for JDBC {@link Connection} based transactions
@ -44,7 +41,8 @@ import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class JdbcIsolationDelegate implements IsolationDelegate { public class JdbcIsolationDelegate implements IsolationDelegate {
private static final Logger log = LoggerFactory.getLogger( JdbcIsolationDelegate.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JdbcIsolationDelegate.class.getName());
private final TransactionCoordinator transactionCoordinator; private final TransactionCoordinator transactionCoordinator;
@ -87,7 +85,7 @@ public class JdbcIsolationDelegate implements IsolationDelegate {
} }
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.info( "unable to rollback connection on exception [" + ignore + "]" ); LOG.unableToRollbackConnection(ignore);
} }
if ( e instanceof HibernateException ) { if ( e instanceof HibernateException ) {
@ -106,14 +104,14 @@ public class JdbcIsolationDelegate implements IsolationDelegate {
connection.setAutoCommit( true ); connection.setAutoCommit( true );
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.trace( "was unable to reset connection back to auto-commit" ); LOG.trace("was unable to reset connection back to auto-commit");
} }
} }
try { try {
connectionProvider().closeConnection( connection ); connectionProvider().closeConnection( connection );
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.info( "Unable to release isolated connection [" + ignore + "]" ); LOG.unableToReleaseIsolatedConnection(ignore);
} }
} }
} }
@ -151,7 +149,7 @@ public class JdbcIsolationDelegate implements IsolationDelegate {
} }
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.info( "unable to rollback connection on exception [" + ignore + "]" ); LOG.unableToRollbackConnection(ignore);
} }
if ( e instanceof HibernateException ) { if ( e instanceof HibernateException ) {
@ -170,14 +168,14 @@ public class JdbcIsolationDelegate implements IsolationDelegate {
connection.setAutoCommit( true ); connection.setAutoCommit( true );
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.trace( "was unable to reset connection back to auto-commit" ); LOG.trace("was unable to reset connection back to auto-commit");
} }
} }
try { try {
connectionProvider().closeConnection( connection ); connectionProvider().closeConnection( connection );
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.info( "Unable to release isolated connection [" + ignore + "]" ); LOG.unableToReleaseIsolatedConnection(ignore);
} }
} }
} }

View File

@ -23,18 +23,17 @@
*/ */
package org.hibernate.engine.transaction.internal.jdbc; package org.hibernate.engine.transaction.internal.jdbc;
import java.sql.Connection;
import java.sql.SQLException;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.TransactionException; import org.hibernate.TransactionException;
import org.hibernate.engine.transaction.spi.AbstractTransactionImpl; import org.hibernate.engine.transaction.spi.AbstractTransactionImpl;
import org.hibernate.engine.transaction.spi.IsolationDelegate; import org.hibernate.engine.transaction.spi.IsolationDelegate;
import org.hibernate.engine.transaction.spi.JoinStatus; import org.hibernate.engine.transaction.spi.JoinStatus;
import org.hibernate.engine.transaction.spi.LocalStatus; import org.hibernate.engine.transaction.spi.LocalStatus;
import org.hibernate.engine.transaction.spi.TransactionCoordinator; import org.hibernate.engine.transaction.spi.TransactionCoordinator;
import org.slf4j.Logger; import org.jboss.logging.Logger;
import org.slf4j.LoggerFactory;
import java.sql.Connection;
import java.sql.SQLException;
/** /**
* {@link org.hibernate.Transaction} implementation based on transaction management through a JDBC {@link java.sql.Connection}. * {@link org.hibernate.Transaction} implementation based on transaction management through a JDBC {@link java.sql.Connection}.
@ -46,7 +45,8 @@ import java.sql.SQLException;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class JdbcTransaction extends AbstractTransactionImpl { public class JdbcTransaction extends AbstractTransactionImpl {
private static final Logger log = LoggerFactory.getLogger( JdbcTransaction.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JdbcTransaction.class.getName());
private Connection managedConnection; private Connection managedConnection;
private boolean wasInitiallyAutoCommit; private boolean wasInitiallyAutoCommit;
@ -64,11 +64,9 @@ public class JdbcTransaction extends AbstractTransactionImpl {
} }
managedConnection = transactionCoordinator().getJdbcCoordinator().getLogicalConnection().getConnection(); managedConnection = transactionCoordinator().getJdbcCoordinator().getLogicalConnection().getConnection();
wasInitiallyAutoCommit = managedConnection.getAutoCommit(); wasInitiallyAutoCommit = managedConnection.getAutoCommit();
if ( log.isDebugEnabled() ) { LOG.debug("initial autocommit status: " + wasInitiallyAutoCommit);
log.debug( "initial autocommit status: " + wasInitiallyAutoCommit );
}
if ( wasInitiallyAutoCommit ) { if ( wasInitiallyAutoCommit ) {
log.debug( "disabling autocommit" ); LOG.debug("disabling autocommit");
managedConnection.setAutoCommit( false ); managedConnection.setAutoCommit( false );
} }
} }
@ -110,7 +108,7 @@ public class JdbcTransaction extends AbstractTransactionImpl {
protected void doCommit() throws TransactionException { protected void doCommit() throws TransactionException {
try { try {
managedConnection.commit(); managedConnection.commit();
log.debug( "committed JDBC Connection" ); LOG.debug("committed JDBC Connection");
} }
catch( SQLException e ) { catch( SQLException e ) {
throw new TransactionException( "unable to commit against JDBC connection", e ); throw new TransactionException( "unable to commit against JDBC connection", e );
@ -123,13 +121,13 @@ public class JdbcTransaction extends AbstractTransactionImpl {
private void releaseManagedConnection() { private void releaseManagedConnection() {
try { try {
if ( wasInitiallyAutoCommit ) { if ( wasInitiallyAutoCommit ) {
log.debug( "re-enabling autocommit" ); LOG.debug("re-enabling autocommit");
managedConnection.setAutoCommit( true ); managedConnection.setAutoCommit( true );
} }
managedConnection = null; managedConnection = null;
} }
catch ( Exception e ) { catch ( Exception e ) {
log.debug( "Could not toggle autocommit", e ); LOG.debug("Could not toggle autocommit", e);
} }
} }
@ -147,7 +145,7 @@ public class JdbcTransaction extends AbstractTransactionImpl {
transactionCoordinator().getTransactionContext().managedClose(); transactionCoordinator().getTransactionContext().managedClose();
} }
catch (HibernateException e) { catch (HibernateException e) {
log.info( "Could not close session; swallowing exception as transaction completed", e ); LOG.unableToCloseSessionButSwallowingError(e);
} }
} }
} }
@ -161,7 +159,7 @@ public class JdbcTransaction extends AbstractTransactionImpl {
protected void doRollback() throws TransactionException { protected void doRollback() throws TransactionException {
try { try {
managedConnection.rollback(); managedConnection.rollback();
log.debug( "rolled JDBC Connection" ); LOG.debug("rolled JDBC Connection");
} }
catch( SQLException e ) { catch( SQLException e ) {
throw new TransactionException( "unable to rollback against JDBC connection", e ); throw new TransactionException( "unable to rollback against JDBC connection", e );

View File

@ -29,17 +29,15 @@ import javax.transaction.NotSupportedException;
import javax.transaction.SystemException; import javax.transaction.SystemException;
import javax.transaction.Transaction; import javax.transaction.Transaction;
import javax.transaction.TransactionManager; import javax.transaction.TransactionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.engine.transaction.spi.IsolationDelegate; import org.hibernate.engine.transaction.spi.IsolationDelegate;
import org.hibernate.engine.transaction.spi.TransactionCoordinator; import org.hibernate.engine.transaction.spi.TransactionCoordinator;
import org.hibernate.jdbc.ReturningWork; import org.hibernate.jdbc.ReturningWork;
import org.hibernate.jdbc.Work; import org.hibernate.jdbc.Work;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.jboss.logging.Logger;
/** /**
* An isolation delegate for JTA environments. * An isolation delegate for JTA environments.
@ -47,7 +45,8 @@ import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class JtaIsolationDelegate implements IsolationDelegate { public class JtaIsolationDelegate implements IsolationDelegate {
private static final Logger log = LoggerFactory.getLogger( JtaIsolationDelegate.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JtaIsolationDelegate.class.getName());
private final TransactionCoordinator transactionCoordinator; private final TransactionCoordinator transactionCoordinator;
@ -83,9 +82,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
try { try {
// First we suspend any current JTA transaction // First we suspend any current JTA transaction
Transaction surroundingTransaction = transactionManager.suspend(); Transaction surroundingTransaction = transactionManager.suspend();
if ( log.isDebugEnabled() ) { LOG.debugf("Surrounding JTA transaction suspended [%s]", surroundingTransaction);
log.debug( "surrounding JTA transaction suspended [" + surroundingTransaction + "]" );
}
boolean hadProblems = false; boolean hadProblems = false;
try { try {
@ -104,9 +101,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
finally { finally {
try { try {
transactionManager.resume( surroundingTransaction ); transactionManager.resume( surroundingTransaction );
if ( log.isDebugEnabled() ) { LOG.debugf("Surrounding JTA transaction resumed [%s]", surroundingTransaction);
log.debug( "surrounding JTA transaction resumed [" + surroundingTransaction + "]" );
}
} }
catch( Throwable t ) { catch( Throwable t ) {
// if the actually work had an error use that, otherwise error based on t // if the actually work had an error use that, otherwise error based on t
@ -137,7 +132,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
transactionManager.rollback(); transactionManager.rollback();
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.info( "Unable to rollback isolated transaction on error [" + e + "] : [" + ignore + "]" ); LOG.unableToRollbackIsolatedTransaction(e, ignore);
} }
} }
} }
@ -173,7 +168,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
connectionProvider().closeConnection( connection ); connectionProvider().closeConnection( connection );
} }
catch ( Throwable ignore ) { catch ( Throwable ignore ) {
log.info( "Unable to release isolated connection [" + ignore + "]" ); LOG.unableToReleaseIsolatedConnection(ignore);
} }
} }
} }
@ -189,9 +184,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
try { try {
// First we suspend any current JTA transaction // First we suspend any current JTA transaction
Transaction surroundingTransaction = transactionManager.suspend(); Transaction surroundingTransaction = transactionManager.suspend();
if ( log.isDebugEnabled() ) { LOG.debugf("Surrounding JTA transaction suspended [%s]", surroundingTransaction);
log.debug( "surrounding JTA transaction suspended [" + surroundingTransaction + "]" );
}
boolean hadProblems = false; boolean hadProblems = false;
try { try {
@ -210,9 +203,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
finally { finally {
try { try {
transactionManager.resume( surroundingTransaction ); transactionManager.resume( surroundingTransaction );
if ( log.isDebugEnabled() ) { LOG.debugf("Surrounding JTA transaction resumed [%s]", surroundingTransaction);
log.debug( "surrounding JTA transaction resumed [" + surroundingTransaction + "]" );
}
} }
catch( Throwable t ) { catch( Throwable t ) {
// if the actually work had an error use that, otherwise error based on t // if the actually work had an error use that, otherwise error based on t
@ -244,7 +235,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
transactionManager.rollback(); transactionManager.rollback();
} }
catch ( Exception ignore ) { catch ( Exception ignore ) {
log.info( "Unable to rollback isolated transaction on error [" + e + "] : [" + ignore + "]" ); LOG.unableToRollbackIsolatedTransaction(e, ignore);
} }
} }
} }
@ -281,7 +272,7 @@ public class JtaIsolationDelegate implements IsolationDelegate {
connectionProvider().closeConnection( connection ); connectionProvider().closeConnection( connection );
} }
catch ( Throwable ignore ) { catch ( Throwable ignore ) {
log.info( "Unable to release isolated connection [" + ignore + "]" ); LOG.unableToReleaseIsolatedConnection(ignore);
} }
} }
} }

View File

@ -23,20 +23,19 @@
*/ */
package org.hibernate.engine.transaction.internal.jta; package org.hibernate.engine.transaction.internal.jta;
import javax.transaction.Status;
import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.TransactionException; import org.hibernate.TransactionException;
import org.hibernate.engine.transaction.spi.AbstractTransactionImpl; import org.hibernate.engine.transaction.spi.AbstractTransactionImpl;
import org.hibernate.engine.transaction.spi.IsolationDelegate; import org.hibernate.engine.transaction.spi.IsolationDelegate;
import org.hibernate.engine.transaction.spi.JoinStatus; import org.hibernate.engine.transaction.spi.JoinStatus;
import org.hibernate.engine.transaction.spi.LocalStatus; import org.hibernate.engine.transaction.spi.LocalStatus;
import org.hibernate.engine.transaction.spi.TransactionCoordinator; import org.hibernate.engine.transaction.spi.TransactionCoordinator;
import org.slf4j.Logger; import org.jboss.logging.Logger;
import org.slf4j.LoggerFactory;
import javax.transaction.Status;
import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
/** /**
* Implements a transaction strategy based on transaction management through a JTA {@link UserTransaction}. * Implements a transaction strategy based on transaction management through a JTA {@link UserTransaction}.
@ -46,7 +45,8 @@ import javax.transaction.UserTransaction;
* @author Les Hazlewood * @author Les Hazlewood
*/ */
public class JtaTransaction extends AbstractTransactionImpl { public class JtaTransaction extends AbstractTransactionImpl {
private static final Logger log = LoggerFactory.getLogger( JtaTransaction.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JtaTransaction.class.getName());
private UserTransaction userTransaction; private UserTransaction userTransaction;
@ -64,7 +64,7 @@ public class JtaTransaction extends AbstractTransactionImpl {
@Override @Override
protected void doBegin() { protected void doBegin() {
log.debug( "begin" ); LOG.debug("begin");
userTransaction = jtaPlatform().retrieveUserTransaction(); userTransaction = jtaPlatform().retrieveUserTransaction();
if ( userTransaction == null ) { if ( userTransaction == null ) {
@ -75,7 +75,7 @@ public class JtaTransaction extends AbstractTransactionImpl {
if ( userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION ) { if ( userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION ) {
userTransaction.begin(); userTransaction.begin();
isInitiator = true; isInitiator = true;
log.debug( "Began a new JTA transaction" ); LOG.debug("Began a new JTA transaction");
} }
} }
catch ( Exception e ) { catch ( Exception e ) {
@ -108,7 +108,7 @@ public class JtaTransaction extends AbstractTransactionImpl {
} }
} }
else { else {
log.debug( "Unable to apply requested transaction timeout; no UserTransaction. Will try later" ); LOG.debug("Unable to apply requested transaction timeout; no UserTransaction. Will try later");
} }
} }
} }
@ -146,7 +146,7 @@ public class JtaTransaction extends AbstractTransactionImpl {
try { try {
if ( isInitiator ) { if ( isInitiator ) {
userTransaction.commit(); userTransaction.commit();
log.debug( "Committed JTA UserTransaction" ); LOG.debug("Committed JTA UserTransaction");
} }
} }
catch ( Exception e ) { catch ( Exception e ) {
@ -167,7 +167,7 @@ public class JtaTransaction extends AbstractTransactionImpl {
// this method is a noop if there is a Synchronization! // this method is a noop if there is a Synchronization!
if ( isDriver ) { if ( isDriver ) {
if ( !isInitiator ) { if ( !isInitiator ) {
log.warn( "You should set hibernate.transaction.manager_lookup_class if cache is enabled" ); LOG.setManagerLookupClass();
} }
try { try {
transactionCoordinator().afterTransaction( this, userTransaction.getStatus() ); transactionCoordinator().afterTransaction( this, userTransaction.getStatus() );
@ -190,7 +190,7 @@ public class JtaTransaction extends AbstractTransactionImpl {
// failed commits automatically rollback the transaction per JTA spec // failed commits automatically rollback the transaction per JTA spec
if ( getLocalStatus() != LocalStatus.FAILED_COMMIT ) { if ( getLocalStatus() != LocalStatus.FAILED_COMMIT ) {
userTransaction.rollback(); userTransaction.rollback();
log.debug( "Rolled back JTA UserTransaction" ); LOG.debug("Rolled back JTA UserTransaction");
} }
} }
else { else {
@ -204,13 +204,13 @@ public class JtaTransaction extends AbstractTransactionImpl {
@Override @Override
public void markRollbackOnly() { public void markRollbackOnly() {
log.trace( "Marking transaction for rollback only" ); LOG.trace("Marking transaction for rollback only");
try { try {
userTransaction.setRollbackOnly(); userTransaction.setRollbackOnly();
log.debug( "set JTA UserTransaction to rollback only" ); LOG.debug("set JTA UserTransaction to rollback only");
} }
catch (SystemException e) { catch (SystemException e) {
log.debug( "Unable to mark transaction for rollback only", e ); LOG.debug("Unable to mark transaction for rollback only", e);
} }
} }

View File

@ -23,14 +23,13 @@
*/ */
package org.hibernate.engine.transaction.spi; package org.hibernate.engine.transaction.spi;
import org.hibernate.HibernateException;
import org.hibernate.TransactionException;
import org.hibernate.service.jta.platform.spi.JtaPlatform;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.transaction.Status; import javax.transaction.Status;
import javax.transaction.Synchronization; import javax.transaction.Synchronization;
import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.TransactionException;
import org.hibernate.service.jta.platform.spi.JtaPlatform;
import org.jboss.logging.Logger;
/** /**
* Abstract support for creating {@link TransactionImplementor transaction} implementations * Abstract support for creating {@link TransactionImplementor transaction} implementations
@ -38,7 +37,9 @@ import javax.transaction.Synchronization;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public abstract class AbstractTransactionImpl implements TransactionImplementor { public abstract class AbstractTransactionImpl implements TransactionImplementor {
private static final Logger log = LoggerFactory.getLogger( AbstractTransactionImpl.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
AbstractTransactionImpl.class.getName());
private final TransactionCoordinator transactionCoordinator; private final TransactionCoordinator transactionCoordinator;
@ -147,7 +148,7 @@ public abstract class AbstractTransactionImpl implements TransactionImplementor
throw new TransactionException( "reuse of Transaction instances not supported" ); throw new TransactionException( "reuse of Transaction instances not supported" );
} }
log.debug( "begin" ); LOG.debug("begin");
doBegin(); doBegin();
@ -162,7 +163,7 @@ public abstract class AbstractTransactionImpl implements TransactionImplementor
throw new TransactionException( "Transaction not successfully started" ); throw new TransactionException( "Transaction not successfully started" );
} }
log.debug( "committing" ); LOG.debug("committing");
beforeTransactionCommit(); beforeTransactionCommit();
@ -192,7 +193,7 @@ public abstract class AbstractTransactionImpl implements TransactionImplementor
throw new TransactionException( "Transaction not successfully started" ); throw new TransactionException( "Transaction not successfully started" );
} }
log.debug( "rolling back" ); LOG.debug("rolling back");
beforeTransactionRollBack(); beforeTransactionRollBack();

View File

@ -23,11 +23,10 @@
*/ */
package org.hibernate.engine.transaction.synchronization.internal; package org.hibernate.engine.transaction.synchronization.internal;
import org.hibernate.engine.transaction.synchronization.spi.SynchronizationCallbackCoordinator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.transaction.Synchronization; import javax.transaction.Synchronization;
import org.hibernate.HibernateLogger;
import org.hibernate.engine.transaction.synchronization.spi.SynchronizationCallbackCoordinator;
import org.jboss.logging.Logger;
/** /**
* The JTA {@link javax.transaction.Synchronization} Hibernate registers when needed for JTA callbacks * The JTA {@link javax.transaction.Synchronization} Hibernate registers when needed for JTA callbacks
@ -35,7 +34,9 @@ import javax.transaction.Synchronization;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class RegisteredSynchronization implements Synchronization { public class RegisteredSynchronization implements Synchronization {
private static final Logger log = LoggerFactory.getLogger( RegisteredSynchronization.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
RegisteredSynchronization.class.getName());
private final SynchronizationCallbackCoordinator synchronizationCallbackCoordinator; private final SynchronizationCallbackCoordinator synchronizationCallbackCoordinator;
@ -47,7 +48,7 @@ public class RegisteredSynchronization implements Synchronization {
* {@inheritDoc} * {@inheritDoc}
*/ */
public void beforeCompletion() { public void beforeCompletion() {
log.trace( "JTA sync : beforeCompletion()" ); LOG.trace("JTA sync : beforeCompletion()");
synchronizationCallbackCoordinator.beforeCompletion(); synchronizationCallbackCoordinator.beforeCompletion();
} }
@ -55,7 +56,7 @@ public class RegisteredSynchronization implements Synchronization {
* {@inheritDoc} * {@inheritDoc}
*/ */
public void afterCompletion(int status) { public void afterCompletion(int status) {
log.trace( "JTA sync : afterCompletion({})", status ); LOG.tracef("JTA sync : afterCompletion(%s)", status);
synchronizationCallbackCoordinator.afterCompletion( status ); synchronizationCallbackCoordinator.afterCompletion( status );
} }
} }

View File

@ -24,6 +24,7 @@
package org.hibernate.service.jta.platform.internal; package org.hibernate.service.jta.platform.internal;
import java.util.Map; import java.util.Map;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.HibernateLogger;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.internal.util.jndi.JndiHelper; import org.hibernate.internal.util.jndi.JndiHelper;
import org.hibernate.service.classloading.spi.ClassLoaderService; import org.hibernate.service.classloading.spi.ClassLoaderService;
@ -32,8 +33,7 @@ import org.hibernate.service.jta.platform.spi.JtaPlatformException;
import org.hibernate.service.spi.ServiceInitiator; import org.hibernate.service.spi.ServiceInitiator;
import org.hibernate.service.spi.ServiceRegistry; import org.hibernate.service.spi.ServiceRegistry;
import org.hibernate.transaction.TransactionManagerLookup; import org.hibernate.transaction.TransactionManagerLookup;
import org.slf4j.Logger; import org.jboss.logging.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Standard initiator for the standard {@link org.hibernate.service.jta.platform.spi.JtaPlatform} * Standard initiator for the standard {@link org.hibernate.service.jta.platform.spi.JtaPlatform}
@ -44,7 +44,7 @@ public class JtaPlatformInitiator implements ServiceInitiator<JtaPlatform> {
public static final JtaPlatformInitiator INSTANCE = new JtaPlatformInitiator(); public static final JtaPlatformInitiator INSTANCE = new JtaPlatformInitiator();
public static final String JTA_PLATFORM = "hibernate.jta.platform"; public static final String JTA_PLATFORM = "hibernate.jta.platform";
private static final Logger log = LoggerFactory.getLogger( JtaPlatformInitiator.class ); private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JtaPlatformInitiator.class.getName());
@Override @Override
public Class<JtaPlatform> getServiceInitiated() { public Class<JtaPlatform> getServiceInitiated() {
@ -72,7 +72,7 @@ public class JtaPlatformInitiator implements ServiceInitiator<JtaPlatform> {
final String platformImplName = platform.toString(); final String platformImplName = platform.toString();
final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class ); final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
try { try {
jtaPlatformImplClass = (Class<JtaPlatform>) classLoaderService.classForName( platformImplName ); jtaPlatformImplClass = classLoaderService.classForName( platformImplName );
} }
catch ( Exception e ) { catch ( Exception e ) {
throw new HibernateException( "Unable to locate specified JtaPlatform class [" + platformImplName + "]", e ); throw new HibernateException( "Unable to locate specified JtaPlatform class [" + platformImplName + "]", e );
@ -92,14 +92,12 @@ public class JtaPlatformInitiator implements ServiceInitiator<JtaPlatform> {
if ( platform == null ) { if ( platform == null ) {
final String transactionManagerLookupImplName = (String) configVales.get( Environment.TRANSACTION_MANAGER_STRATEGY ); final String transactionManagerLookupImplName = (String) configVales.get( Environment.TRANSACTION_MANAGER_STRATEGY );
if ( transactionManagerLookupImplName != null ) { if ( transactionManagerLookupImplName != null ) {
log.warn( LOG.deprecatedTransactionManagerStrategy(TransactionManagerLookup.class.getName(),
"Using deprecated " + TransactionManagerLookup.class.getName() + " strategy [" + Environment.TRANSACTION_MANAGER_STRATEGY,
Environment.TRANSACTION_MANAGER_STRATEGY + JtaPlatform.class.getName(),
"], use newer " + JtaPlatform.class.getName() + JTA_PLATFORM);
" strategy instead [" + JTA_PLATFORM + "]"
);
platform = mapLegacyClasses( transactionManagerLookupImplName, configVales, registry ); platform = mapLegacyClasses( transactionManagerLookupImplName, configVales, registry );
log.debug( "Mapped {} -> {}", transactionManagerLookupImplName, platform ); LOG.debugf("Mapped %s -> %s", transactionManagerLookupImplName, platform);
} }
} }
return platform; return platform;
@ -113,11 +111,7 @@ public class JtaPlatformInitiator implements ServiceInitiator<JtaPlatform> {
return null; return null;
} }
log.info( LOG.legacyTransactionManagerStrategy(JtaPlatform.class.getName(), JTA_PLATFORM);
"Encountered legacy TransactionManagerLookup specified; convert to newer " +
JtaPlatform.class.getName() + " contract specified via " +
JTA_PLATFORM + "setting"
);
if ( "org.hibernate.transaction.BESTransactionManagerLookup".equals( transactionManagerLookupImplName ) ) { if ( "org.hibernate.transaction.BESTransactionManagerLookup".equals( transactionManagerLookupImplName ) ) {
return new BorlandEnterpriseServerJtaPlatform(); return new BorlandEnterpriseServerJtaPlatform();

View File

@ -23,13 +23,12 @@
*/ */
package org.hibernate.service.jta.platform.internal; package org.hibernate.service.jta.platform.internal;
import org.hibernate.service.jta.platform.spi.JtaPlatformException; import java.lang.reflect.Method;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.transaction.TransactionManager; import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction; import javax.transaction.UserTransaction;
import java.lang.reflect.Method; import org.hibernate.HibernateLogger;
import org.hibernate.service.jta.platform.spi.JtaPlatformException;
import org.jboss.logging.Logger;
/** /**
* JTA platform implementation for WebSphere (versions 4, 5.0 and 5.1) * JTA platform implementation for WebSphere (versions 4, 5.0 and 5.1)
@ -38,7 +37,8 @@ import java.lang.reflect.Method;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class WebSphereJtaPlatform extends AbstractJtaPlatform { public class WebSphereJtaPlatform extends AbstractJtaPlatform {
private static final Logger log = LoggerFactory.getLogger( WebSphereJtaPlatform.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, WebSphereJtaPlatform.class.getName());
public static final String VERSION_5_UT_NAME = "java:comp/UserTransaction"; public static final String VERSION_5_UT_NAME = "java:comp/UserTransaction";
public static final String VERSION_4_UT_NAME = "jta/usertransaction"; public static final String VERSION_4_UT_NAME = "jta/usertransaction";
@ -55,18 +55,18 @@ public class WebSphereJtaPlatform extends AbstractJtaPlatform {
try { try {
clazz = Class.forName( "com.ibm.ws.Transaction.TransactionManagerFactory" ); clazz = Class.forName( "com.ibm.ws.Transaction.TransactionManagerFactory" );
version = 5; version = 5;
log.debug( "WebSphere 5.1" ); LOG.debug("WebSphere 5.1");
} }
catch ( Exception e ) { catch ( Exception e ) {
try { try {
clazz = Class.forName( "com.ibm.ejs.jts.jta.TransactionManagerFactory" ); clazz = Class.forName( "com.ibm.ejs.jts.jta.TransactionManagerFactory" );
version = 5; version = 5;
log.debug( "WebSphere 5.0" ); LOG.debug("WebSphere 5.0");
} }
catch ( Exception e2 ) { catch ( Exception e2 ) {
clazz = Class.forName( "com.ibm.ejs.jts.jta.JTSXA" ); clazz = Class.forName( "com.ibm.ejs.jts.jta.JTSXA" );
version = 4; version = 4;
log.debug( "WebSphere 4" ); LOG.debug("WebSphere 4");
} }
} }

View File

@ -23,34 +23,28 @@
*/ */
package org.hibernate.test.common.jta; package org.hibernate.test.common.jta;
import com.atomikos.icatch.jta.UserTransactionImp; import javax.sql.DataSource;
import com.atomikos.icatch.jta.UserTransactionManager; import javax.transaction.TransactionManager;
import com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean; import javax.transaction.UserTransaction;
import org.hibernate.HibernateLogger;
import org.hibernate.service.internal.ServiceProxy;
import org.hibernate.service.jta.platform.internal.AbstractJtaPlatform; import org.hibernate.service.jta.platform.internal.AbstractJtaPlatform;
import org.hibernate.service.jta.platform.internal.JtaSynchronizationStrategy; import org.hibernate.service.jta.platform.internal.JtaSynchronizationStrategy;
import org.hibernate.service.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy; import org.hibernate.service.jta.platform.internal.TransactionManagerBasedSynchronizationStrategy;
import org.hibernate.service.jta.platform.spi.JtaPlatform;
import org.hibernate.service.jta.platform.spi.JtaPlatformException; import org.hibernate.service.jta.platform.spi.JtaPlatformException;
import org.hibernate.service.spi.ServiceRegistry;
import org.hibernate.service.spi.Startable; import org.hibernate.service.spi.Startable;
import org.hibernate.service.spi.Stoppable; import org.hibernate.service.spi.Stoppable;
import org.hibernate.test.common.ConnectionProviderBuilder; import org.hibernate.test.common.ConnectionProviderBuilder;
import org.jboss.logging.Logger;
import org.slf4j.Logger; import com.atomikos.icatch.jta.UserTransactionImp;
import org.slf4j.LoggerFactory; import com.atomikos.icatch.jta.UserTransactionManager;
import com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean;
import javax.sql.DataSource;
import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class AtomikosJtaPlatform extends AbstractJtaPlatform implements Startable, Stoppable { public class AtomikosJtaPlatform extends AbstractJtaPlatform implements Startable, Stoppable {
private static final Logger log = LoggerFactory.getLogger( AtomikosJtaPlatform.class );
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, AtomikosJtaPlatform.class.getName());
private final JtaSynchronizationStrategy synchronizationStrategy = new TransactionManagerBasedSynchronizationStrategy( this ); private final JtaSynchronizationStrategy synchronizationStrategy = new TransactionManagerBasedSynchronizationStrategy( this );
@ -113,7 +107,7 @@ public class AtomikosJtaPlatform extends AbstractJtaPlatform implements Startabl
dataSourceBean.close(); dataSourceBean.close();
} }
catch (Exception e) { catch (Exception e) {
log.debug( "Error closing DataSourceBean", e ); LOG.debug("Error closing DataSourceBean", e);
} }
} }
@ -122,7 +116,7 @@ public class AtomikosJtaPlatform extends AbstractJtaPlatform implements Startabl
transactionManager.close(); transactionManager.close();
} }
catch (Exception e) { catch (Exception e) {
log.debug( "Error closing UserTransactionManager", e ); LOG.debug("Error closing UserTransactionManager", e);
} }
} }
} }