cancel
Showing results for 
Search instead for 
Did you mean: 

Facing Some synchronising Issues

Former Member
0 Kudos

hi,

I have some record in our "SQL DATABASE" And it is also present  in our cache database but when user synchronise user did not get that record on the same date when this record inserted into the CacheDataBase .

After one day, when  user syncs he get that data. Kindly let me know   why this delay occurs??

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Please help me out for this issue. I face this issues in live.

midhun_vp
Active Contributor
0 Kudos

Help me understand why you are doing these many subscriptions. What is the version of your SUP ?

Use the below code as reference (implemented in sup 2.2):

app = Application.getInstance();

  app.setApplicationIdentifier("POApproval");

try {

ConnectionProperties connProps = app.getConnectionProperties();

  1. connProps.setFarmId("0");
  2. connProps.setServerName("10.10.10.10");
  3. connProps.setPortNumber(Integer.parseInt("5001"));// MBS
  4. PODB.setApplication(app);

LoginCredentials loginCredentials = new LoginCredentials(

"supAdmin","s3pAdmin");

  1. connProps.setLoginCredentials(loginCredentials);

if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {

  1. app.registerApplication(600);

} else {

  1. app.startConnection(600);

}

} catch (Exception e) {

returnMsg = e.getMessage();

}

if (returnMsg == "success") {

try {

if (!PODB.databaseExists()) {

  1. PODB.createDatabase();

} else {

  1. PODB.openConnection();

}

ConnectionProfile connectionProfile = BarcodeReaderDB

.getSynchronizationProfile();

connectionProfile

.setNetworkStreamParams("url_suffix=/ias_relay_server/client/rs_client.dll/0");// SYNC_NETSTREAMPARAMS

// =

  1. Log.d("Step", "network stream"); // "url_suffix=/ias_relay_server/client/rs_client.dll/"

  1. connectionProfile.setServerName("10.10.10.10");
  2. connectionProfile.setPortNumber(2480);// RBS port
  3. connectionProfile.setNetworkProtocol("http");
  4. connectionProfile.setAsyncReplay(true);
  5. connectionProfile.setDomainName("default");
  6. connectionProfile.save();

  1. BarcodeReaderDB.subscribe();
  2. BarcodeReaderDB.submitPendingOperations();


Sync code:


PODB.synchronize();

for(MBOList list:MBOList.findAll())

  {

  count++;

  }

-Midhun VP

Former Member
0 Kudos

hi,

I have done this subscriptions becase i set synchronisation parameters in diferent mbo. I done this in sup 2.2 sp04. It is RBS based application.

You used two DB ie BarcodeReaderDB and PODB . Can u please tell me why two db is used.

What is the purpose of subscribe:?

When and why database create .By default database is created .. Please help me understand your code.

midhun_vp
Active Contributor
0 Kudos

Ignore the two DB names, you can replace BarcodeReaderDB with PODB. Since you are using sync parameters in your code have a look at this information that explains how to use sync key, you need to delete the sync key each time before sync else it results in unexpected results.

- Midhun VP

Former Member
0 Kudos

after connections

UserSubscription userSynchronizationParameters = new UserSubscription();
userSynchronizationParameters.setLoginId(userName);
User.addSubscription(userSynchronizationParameters);

APHSmCRMDB.synchronize(Constants.SYNC_GROUP_USER);

List<User> userList = User.findAll();

if (CollectionUtils.isEmpty(userList))
{
return new Response(false, getResources().getString(R.string.user_sync_failed), null);
}

User user = userList.get(0);

TerritoryUserSubscription territoryUserSynchronizationParameters = new TerritoryUserSubscription();
territoryUserSynchronizationParameters.setLocationCode(user.getTERRITORY_CODE());
TerritoryUser.addSubscription(territoryUserSynchronizationParameters);

SiteHeadPainterContractorMappingSubscription siteHeadPainterContractorMappingSynchronizationParameters = new SiteHeadPainterContractorMappingSubscription();
siteHeadPainterContractorMappingSynchronizationParameters.setLocationCode(user.getUNIT_CODE());
SiteHeadPainterContractorMapping.addSubscription(siteHeadPainterContractorMappingSynchronizationParameters);

Painting_SystemSubscription paintingSystemSynchronizationParameters = new Painting_SystemSubscription();
paintingSystemSynchronizationParameters.setLocationUnitCode(user.getUNIT_CODE().trim());
Painting_System.addSubscription(paintingSystemSynchronizationParameters);

HolidaysSubscription holidaysSynchronizationParameters = new HolidaysSubscription();
holidaysSynchronizationParameters.setUnitCode(user.getUNIT_CODE().trim());
Holidays.addSubscription(holidaysSynchronizationParameters);

AppointmentSubscription appointmentSynchronizationParameters = new AppointmentSubscription();
appointmentSynchronizationParameters.setUserCode(user.getUSER_CODE());
Appointment.addSubscription(appointmentSynchronizationParameters);

Sales_OpportunitySubscription opportunitySynchronizationParameters = new Sales_OpportunitySubscription();
opportunitySynchronizationParameters.setUserCode(user.getUSER_CODE());
Sales_Opportunity.addSubscription(opportunitySynchronizationParameters);

SiteSubscription siteSynchronizationParameters = new SiteSubscription();
siteSynchronizationParameters.setUserCode(user.getUSER_CODE());
Site.addSubscription(siteSynchronizationParameters);

CustomerSubscription customerSynchronizationParameters = new CustomerSubscription();
customerSynchronizationParameters.setUserCode(user.getUSER_CODE());
Customer.addSubscription(customerSynchronizationParameters);

APHSmCRMDB.synchronize();

i done that code

Former Member
0 Kudos

ConnectionProperties connectionProperties = application.getConnectionProperties();

  connectionProperties.setServerName(getResources().getString(R.string.server_url));

  connectionProperties.setPortNumber(Constants.MESSAGING_PORT);

  connectionProperties.setFarmId(getResources().getString(R.string.farm_id));

  LoginCredentials credentials = new LoginCredentials(userName, password);

  connectionProperties.setLoginCredentials(credentials);

  ConnectionProfile syncProfile = APHSmCRMDB.getSynchronizationProfile();

  syncProfile.setServerName(getResources().getString(R.string.server_url));

  syncProfile.setPortNumber(Constants.REPLICATION_PORT);

  syncProfile.setNetworkProtocol("http");

  NetworkStreamParams streamParams = syncProfile.getStreamParams();

  streamParams.setUrl_Suffix(getResources().getString(R.string.url_suffix));

  syncProfile.setCacheSize(102400);

  syncProfile.setDomainName("default");

  syncProfile.setAsyncReplay(true);

  syncProfile.save()

midhun_vp
Active Contributor
0 Kudos

Where you are using the synchronize API  and the query ?

midhun_vp
Active Contributor
0 Kudos

Is there any load parameter in the MBO created ? If yes to which key it is mapped to (PK or SK) ? What is the cache policy of MBO ? Have you checked by changing the detection interval in sync group.

- Midhun VP

Former Member
0 Kudos

hi,

i didnot use any load parameter for that MBO or any PK. MBO Cache Policy is scheduled  after 10 min.Data get refresh in CDB after 10 min but delay is occurs when we sync from device .Sync

DetectionInterval is 1o mins . Is there any dependancy of synchronisation detection iterval in synchronisation Group?

midhun_vp
Active Contributor
0 Kudos

Keep the sync detection  interval to lowest and try.

- Midhun VP

Former Member
0 Kudos

it is delay with 24 hours and 48 hours. If record is present in CDB then after doing sync from device why the record is not show on device, why delay is occurs. what is the reason behind it.

midhun_vp
Active Contributor
0 Kudos

Can you post the code you written for sync.