Author: timothyjward
Date: Fri Jul 22 16:52:19 2016
New Revision: 1753812

URL: http://svn.apache.org/viewvc?rev=1753812&view=rev
Log:
[tx-control] Register the recovery service before the ResourceProvider so that 
recovery is always available before someone uses the service

Modified:
    
aries/trunk/tx-control/tx-control-provider-jdbc-xa/src/main/java/org/apache/aries/tx/control/jdbc/xa/impl/ManagedServiceFactoryImpl.java

Modified: 
aries/trunk/tx-control/tx-control-provider-jdbc-xa/src/main/java/org/apache/aries/tx/control/jdbc/xa/impl/ManagedServiceFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/tx-control/tx-control-provider-jdbc-xa/src/main/java/org/apache/aries/tx/control/jdbc/xa/impl/ManagedServiceFactoryImpl.java?rev=1753812&r1=1753811&r2=1753812&view=diff
==============================================================================
--- 
aries/trunk/tx-control/tx-control-provider-jdbc-xa/src/main/java/org/apache/aries/tx/control/jdbc/xa/impl/ManagedServiceFactoryImpl.java
 (original)
+++ 
aries/trunk/tx-control/tx-control-provider-jdbc-xa/src/main/java/org/apache/aries/tx/control/jdbc/xa/impl/ManagedServiceFactoryImpl.java
 Fri Jul 22 16:52:19 2016
@@ -206,23 +206,21 @@ public class ManagedServiceFactoryImpl i
                                try {
                                        JDBCConnectionProviderImpl provider = 
new JDBCConnectionProviderFactoryImpl().getProviderFor(service,
                                                        jdbcProperties, 
providerProperties);
-                                       reg = context
-                                                       
.registerService(JDBCConnectionProvider.class, provider, 
getServiceProperties());
-
-                                       
                                        String recoveryId = (String) 
providerProperties.get(OSGI_RECOVERY_IDENTIFIER);
                                        if(recoveryId !=null) {
                                                
if(toBoolean(providerProperties, XA_ENLISTMENT_ENABLED, true)) {
                                                        LOG.warn("A 
JDBCResourceProvider has been configured with a recovery identifier {} but it 
has also been configured not to use XA transactions. No recovery will be 
available.", recoveryId);
                                                } else {
                                                        reg2 = 
context.registerService(RecoverableXAResource.class, 
-                                                                               
        new RecoverableXAResourceImpl(recoveryId, provider, 
-                                                                               
                        (String) providerProperties.get("recovery.user"),
-                                                                               
                        (String) 
providerProperties.get(".recovery.password)")), 
-                                                                               
                        getServiceProperties());
+                                                                       new 
RecoverableXAResourceImpl(recoveryId, provider, 
+                                                                               
        (String) providerProperties.get("recovery.user"),
+                                                                               
        (String) providerProperties.get(".recovery.password)")), 
+                                                                       
getServiceProperties());
                                                }
                                        }
-                                       
+                                       reg = context
+                                                       
.registerService(JDBCConnectionProvider.class, provider, 
getServiceProperties());
+
                                        
ServiceRegistration<JDBCConnectionProvider> oldReg;
                                        
ServiceRegistration<RecoverableXAResource> oldReg2;
                                        


Reply via email to