diff --git a/src/org/openbravo/mobile/core/servercontroller/MobileServerStatusInformation.java b/src/org/openbravo/mobile/core/servercontroller/MobileServerStatusInformation.java
--- a/src/org/openbravo/mobile/core/servercontroller/MobileServerStatusInformation.java
+++ b/src/org/openbravo/mobile/core/servercontroller/MobileServerStatusInformation.java
@@ -26,7 +26,6 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.mobile.core.process.JSONRowConverter;
 import org.openbravo.mobile.core.process.ProcessHQLQuery;
-import org.openbravo.model.ad.system.Client;
 
 @AuthenticationManager.Stateless
 public class MobileServerStatusInformation extends ProcessHQLQuery {
@@ -66,11 +65,10 @@
         .createQuery("UPDATE OBMOBC_SERVER_DEFINITION SET lastPing=now() WHERE servertype = 'MAIN'");
     query.executeUpdate();
 
-    if (lastPingFromCentralWasExpired) {
-      log.info("Ping received from central server after >3 pings missed. Transitioning to online.");
-      OBContext.getOBContext().setCurrentClient(
-          OBDal.getInstance().getProxy(Client.class,
-              MobileServerController.getInstance().getThisServerClientId()));
+    if (lastPingFromCentralWasExpired
+        || !MobileServerState.ONLINE.equals(MobileServerController.getInstance()
+            .getThisMobileServerState())) {
+      log.info("Store offline, new Ping received from central server after >3 pings missed. Transitioning to online.");
       // if the last ping from the central server was received a long time ago that probably means
       // the central server has been offline, try to make the store server transition to online
       MobileServerController.getInstance().forceTransitionToOnline();
diff --git a/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java b/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
--- a/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
+++ b/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
@@ -224,7 +224,7 @@
     int pingPeriodicitySeconds = 300;
     try {
       pingPeriodicitySeconds = Integer.parseInt(Preferences.getPreferenceValue(
-          "OBMOBC_Ping_Periodicity", true, "0", "0", "100", null, (String) null));
+          "OBMOBC_Ping_Periodicity", true, null, null, null, null, (String) null));
     } catch (PropertyException e) {
       // the default value of 5 minutes (300 seconds) will be used
     }
