HHH-8238 OsgiJtaPlatform null pointer exception

Conflicts:
	hibernate-osgi/src/main/java/org/hibernate/osgi/OsgiJtaPlatform.java
This commit is contained in:
Brett Meyer 2013-05-16 11:47:37 -04:00
parent 920ba3641f
commit 79c3658ac2
1 changed files with 4 additions and 4 deletions

View File

@ -49,14 +49,14 @@ public class OsgiJtaPlatform implements JtaPlatform {
@Override
public TransactionManager retrieveTransactionManager() {
ServiceReference sr = bundleContext.getServiceReference( TransactionManager.class.getName() );
return (TransactionManager) bundleContext.getService( sr );
final ServiceReference sr = bundleContext.getServiceReference( TransactionManager.class.getName() );
return sr == null ? null : (TransactionManager) bundleContext.getService( sr );
}
@Override
public UserTransaction retrieveUserTransaction() {
ServiceReference sr = bundleContext.getServiceReference( UserTransaction.class.getName() );
return (UserTransaction) bundleContext.getService( sr );
final ServiceReference sr = bundleContext.getServiceReference( UserTransaction.class.getName() );
return sr == null ? null : (UserTransaction) bundleContext.getService( sr );
}
@Override