cancel
Showing results for 
Search instead for 
Did you mean: 

'Subscribe failed exception : name = SUPPersistenceException description = 0 (OK)' during new registration

Former Member
0 Kudos

Hi Experts,

I'm working on iphone native app with SUP 2.1.3. We are getting the SUPPersistanceException while subscribing the local db with SCC. This is occurring only during the new registration of the iphone native app in  SUP 2.1.3 in SCC.

I'm doing the following steps for sup connection on click of loginButton:

  1. Setup NSNotification observers
  2. Get the SupApplication instance and set the appIdentifier and callback handler.
  3. Register the callback handler instance to db class: [SUPDB registerCallbackHandler:callback];
  4. Update the connectionProperties of SUPApplication. (serverName, port, urlSuffix, farmid, loginCredentials, httpCredentials)
  5. Get the SupVault, unlock it and get the key (if exists).
  6. If database exists-->          a) Get the key from the vault b) [[SUPDB connectionProfile] setEncryptionkey:key]; c) clean the SUPDB
  7. If database does not exists-->          a) [SUPDB createDatabase] b) [SUPDB generateEncryptionKey] c) [SUPDB closeConnection] d) update the key into vault and lock vault.
  8. Set the SupApplication instance to dbclass. [SUPDB setApplication:app];
  9. Call registerApplication. [app registerApplication:TIME_OUT];
  10. When the registration/connection success notification triggers i'm updating the database synchronizationProfile. (username, password, servername, portnumber, domainNumber, networkProtocol, networkStreamParameters).
  11. Then calling the [SUPDB subscribe]; causes SUPPersistanceException.  @catch issues [app stopConnection];

When repeating the above steps, step-6c causing the SUPPersistanceException (while cleaning the database).

In both the cases the error description of SUPPersistanceException is : "0 (OK)".

If I quit the application from the memory and run it again, it runs normally and fetches data from sup. I can only repeat the problem on first launch of app from device/simulator. (not everytime)

Please suggest a solution for the above problem. let me know if you need more information.

Thanks in advance.

Sarath.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please find below SQL Trace log information captured before the SUPPersistance exception after subscribe failed :

[23:11:20.938][SQL TRACE][DEBUG] create database :/Users/Company/Library/Application Support/iPhone Simulator/5.1/Applications/C1B38467-779E-4204-9F2F-B278D179BABC/Documents/MBOSUPiOSApp1_0.udb

[23:11:20.944][SQL TRACE][DEBUG] {thread:0x8f82cf0}: connecting to database: /Users/Company/Library/Application Support/iPhone Simulator/5.1/Applications/C1B38467-779E-4204-9F2F-B278D179BABC/Documents/MBOSUPiOSApp1_0.udb.new, returned dbhandle:0x99edb70

[23:11:21.037][SQL TRACE][DEBUG] renaming database: /Users/Company/Library/Application Support/iPhone Simulator/5.1/Applications/C1B38467-779E-4204-9F2F-B278D179BABC/Documents/MBOSUPiOSApp1_0.udb.new -> /Users/Company/Library/Application Support/iPhone Simulator/5.1/Applications/C1B38467-779E-4204-9F2F-B278D179BABC/Documents/MBOSUPiOSApp1_0.udb

[23:11:21.041][SQL TRACE][DEBUG] {thread:0x8f82cf0}: connecting to database: /Users/Company/Library/Application Support/iPhone Simulator/5.1/Applications/C1B38467-779E-4204-9F2F-B278D179BABC/Documents/MBOSUPiOSApp1_0.udb, returned dbhandle:0x99edb70

[23:11:28.469][SQL TRACE][ERROR] {thread:0x8f37360}: fail to get connection: 0, 0 (OK)

0   SUPiOSApp                             0x0021b293 +[SUPSqlTrace error:withThrow:withMessage:] + 275

1   SUPiOSApp                             0x0021b154 +[SUPSqlTrace throwableError::] + 148

2   SUPiOSApp                             0x004aa781 -[sup_ul_db_DatabaseManagerImpl getConnection:] + 4465

3   SUPiOSApp                             0x00248c9e -[SUPAbstractDBRBS getConnectionWrapper] + 478

4   SUPiOSApp                             0x001f0b4b -[SUPKeyGenerator initSync] + 331

5   SUPiOSApp                             0x0019d719 -[SUPDatabaseDelegate initialSync] + 201

6   SUPiOSApp                             0x0019a4e1 -[SUPDatabaseDelegate subscribe] + 49

7   SUPiOSApp                             0x00082bc5 +[MBOSUPiOSAppMBOSUPiOSAppDB subscribe] + 69

8   SUPiOSApp                             0x00059cce -[LoginViewController onLoginSuccess:] + 190

9   Foundation                          0x0245ca29 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 40

10  CoreFoundation                      0x018ce855 ___CFXNotificationPost_block_invoke_0 + 85

11  CoreFoundation                      0x018ce778 _CFXNotificationPost + 1976

12  Foundation                          0x023a1234 -[NSNotificationCenter postNotification:] + 121

13  SUPiOSApp                             0x00004ca0 -[AppDelegate onConnectSuccess:] + 960

14  Foundation                          0x0245ca29 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 40

15  CoreFoundation                      0x018ce855 ___CFXNotificationPost_block_invoke_0 + 85

16  CoreFoundation                      0x018ce778 _CFXNotificationPost + 1976

17  Foundation                          0x023a1234 -[NSNotificationCenter postNotification:] + 121

18  SUPiOSApp                             0x0000add6 -[CallbackHandler sendNotification:] + 86

19  CoreFoundation                      0x01904e42 -[NSObject performSelector:withObject:] + 66

20  Foundation                          0x023c09df __NSThreadPerformPerform + 254

21  CoreFoundation                      0x018d794f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15

22  CoreFoundation                      0x0183ab43 __CFRunLoopDoSources0 + 243

23  CoreFoundation                      0x0183a424 __CFRunLoopRun + 1012

24  CoreFoundation                      0x01839d84 CFRunLoopRunSpecific + 212

25  CoreFoundation                      0x01839c9b CFRunLoopRunInMode + 123

26  GraphicsServices                    0x02fe17d8 GSEventRunModal + 190

27  GraphicsServices                    0x02fe188a GSEventRun + 103

28  UIKit                               0x01a9a626 UIApplicationMain + 1163

29  SUPiOSApp                             0x00002f7f main + 127

30  SUPiOSApp                             0x00002eb5 start + 53

Above log says the db is failed to get connection. but the network is available and the sup is running fine. For reference i've included xcode console logs.

Kindly advise.

Thanks

Former Member
0 Kudos

We are using SUP 2.1.3 using RBS to fetch data from SUP. I realized that subscribe is part of MBS and should not be used in RBS procedure. we commented the [db subscribe], since then app is working fine.

Answers (0)