cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Implementing Persistence

Former Member
0 Kudos

Hi All,

I have implemented Persistence in my application,

Everything works fine as far as Persistence is concerned,

but I am not able to synchronize my application,

whenever I synchronize it

<b>explicitly from Link on MI Client or through code like SyncManager.getInstance().SynchronizeWithBackend()</b>

The MI Client just hangs Up, and I need to restart it,

While this is not the case when I comment out the above line of code,

Please tell me the appropriate cause,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Deepak,

Don't use Persistance with smartsync. Its advocated that way in MDK itself.

if you are using generic sync, did you set your sync password in your code?

is your settings in MobileEngine.Config is like "<b>MobileEngine.Security.SynchronizationPasswordHandlingOption=local</b>"? in this case, your logon password should be same as your sync password.

Rgds

ak.

Former Member
0 Kudos

Hi Arun,

1)Mine is a genericSync Appliation,

2)I have set the password to local in Config file

3)Logon & sync password both are same,

4) I have also set the same password in the code before sync expression

Even though i have problem with this sync processing,

Do we need to do something with closing the Persistence Runtime before starting synchronization,

Please suggest,

Deepak

Former Member
0 Kudos

Deepak,

Did you handle the outboundcontainer properly. ie; did u close the container? can you copy-paste the trace file you find in your mobile device?

rgds

ak

Former Member
0 Kudos

yes Arun,

I closed the outbound container after adding items to it,

then I tries to synchroniza,

ya below is the Trace generated, sorry for the length,

[20060412 06:11:40:523] I [MI/API/Logging ] ***** LOG / TRACE SWITCHED ON

[20060412 06:11:40:523] I [MI/API/Logging ] ***** Mobile Engine version: MI 25 SP 09 Patch 00 Build 200409101427

[20060412 06:11:40:523] I [MI/API/Logging ] ***** Current timezone: Asia/Calcutta

[20060412 06:11:40:539] I [MI ] Trace severity: All (1000)

[20060412 06:11:40:539] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:dispatch request to '/jsp/trace/trace.jsp'

[20060412 06:11:42:823] D [MI/Core ] Set current application to 'MOBILEENGINE_JSP'

[20060412 06:11:42:823] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:doGet(...) called

[20060412 06:11:42:823] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:getEvent() done with event name = ''

[20060412 06:11:42:839] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:dispatch request to '/jsp/trace/list.jsp'

[20060412 06:11:45:512] D [MI/Core ] Set current application to 'MOBILEENGINE_JSP'

[20060412 06:11:45:512] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:doGet(...) called

[20060412 06:11:45:512] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:getEvent() done with event name = ''

[20060412 06:11:45:512] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:dispatch request to '/jsp/home/home.jsp'

[20060412 06:11:48:076] D [MI/Core ] Set current application to 'MOBILEENGINE_JSP'

[20060412 06:11:48:076] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:doGet(...) called

[20060412 06:11:48:076] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:getEvent() done with event name = ''

[20060412 06:11:48:076] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:dispatch request to 'http://localhost:4444/STUDENT_APP/start'

[20060412 06:11:48:076] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:init() called

[20060412 06:11:48:076] D [MI/Core ] Deactivated application MOBILEENGINE_JSP

[20060412 06:11:48:076] I [MI/Smartsync ] Smart Sync framework: framework de-activated an application.

[20060412 06:11:48:076] D [MI/Smartsync ] Smart Sync context switch not necessary for same conversation id

[20060412 06:11:48:092] I [MI/Smartsync ] Smart Sync framework: framework de- activated an application, the smart sync repository has been switched.

[20060412 06:11:48:092] D [MI/Core ] Set current application to 'STUDENT_APP'

[20060412 06:11:48:092] P [MI/Core ] Activate application STUDENT_APP

[20060412 06:11:48:092] I [MI/Smartsync ] Smart Sync framework: framework activated an application.

[20060412 06:11:48:092] D [MI/Smartsync ] Smart Sync context switch not necessary for Generic Sync App: Name: / STUDENT_APP (V. 0.3), Target=, Type=com.sap.ip.me.core.JspApplicationType

[20060412 06:11:48:092] I [MI/Smartsync ] Smart Sync framework: framework activated an application, the smart sync repository has been switched.

[20060412 06:11:48:092] D [MI/Persistence ] beginTransaction() called with doWait=true for instance 23459640

[20060412 06:11:48:092] D [AppLog/Student_App ] MIClientInfo: Create MIClientInfoServlet.doInitialize with Classloader com.sap.ip.me.core.Startup@1b90b39

[20060412 06:11:48:154] D [MI/Core ] Set current application to 'STUDENT_APP'

[20060412 06:11:48:154] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:doGet(...) called

[20060412 06:11:48:154] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:getEvent() done with event name = ''

[20060412 06:11:48:154] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:dispatch request to '/jsp/initial.jsp'

[20060412 06:12:08:001] D [MI/Core ] Set current application to 'STUDENT_APP'

[20060412 06:12:08:001] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:doPost(...) called

[20060412 06:12:08:001] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:getEvent() done with event name = 'save'

[20060412 06:12:08:016] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:dispatch request to '/jsp/initial.jsp'

[20060412 06:12:10:099] D [MI/Core ] Set current application to 'STUDENT_APP'

[20060412 06:12:10:099] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:doPost(...) called

[20060412 06:12:10:099] D [MI/API/Runtime/JSP ] AbstractMEHttpServlet:getEvent() done with event name = 'add'

[20060412 06:12:10:114] D [MI/Sync ] GUID generation last time (1144822330114) was >= than current time (1144822330114) --> use this time instead 1144822330115

[20060412 06:12:10:130] P [MI/Sync ] Created outbound container for user SAPTEST and method CREATE_STUDENT_RECORD

[20060412 06:12:10:146] P [MI/Sync ] Created outbound container for conversationId 0C03B00A2CC9DD4C9CA0EB58CDADCF47 / 0C03B00A2CC9DD4C9CA0EB58CDADCF47 (User: SAPTEST, MSD: Name: / STUDENT_APP (V. 0.3), Target=, Type=com.sap.ip.me.core.JspApplicationType)

[20060412 06:12:10:208] I [MI/Sync ] Synchronize with backend called, Thread=Thread-10

[20060412 06:12:10:208] I [MI/Sync ] Thread=Thread-10 took lock for synchronizeation.

[20060412 06:12:10:208] D [MI/Sync ] Synchronisation: Fire SyncEvent 0

[20060412 06:12:10:223] P [MI/Core ] Thread Thread-10 switched context to MI2853484152454429 / 6A685B074963074791DDFEA206AEDB0B (User: (SHARED), MSD: Name: / MOBILEENGINE_JSP (V. 250900), Target=, Type=com.sap.ip.me.core.FrameworkApplicationType) (stack level 1)

[20060412 06:12:10:223] I [MI/API/Sync ] SyncEvent Performing com.sap.ip.me.sync.LogSender

[20060412 06:12:10:223] P [MI/Sync ] Created outbound container for user (SHARED) and method CENTRAL_TRACING

[20060412 06:12:10:270] P [MI/Sync ] Created outbound container for conversationId MI2853484152454429 / 6A685B074963074791DDFEA206AEDB0B (User: (SHARED), MSD: Name: / MOBILEENGINE_JSP (V. 250900), Target=, Type=com.sap.ip.me.core.FrameworkApplicationType)

[20060412 06:12:10:285] I [AppLog/MI/Sync ] AppLog severity: Warning (60)

[20060412 06:12:10:285] P [MI/Core ] original context restored

[20060412 06:12:10:285] P [MI/Core ] Thread Thread-10 switched context to MI2853484152454429 / 6A685B074963074791DDFEA206AEDB0B (User: (SHARED), MSD: Name: / MOBILEENGINE_JSP (V. 250900), Target=, Type=com.sap.ip.me.core.FrameworkApplicationType) (stack level 1)

[20060412 06:12:10:285] I [MI/API/Sync ] SyncEvent Performing com.sap.ip.me.core.RegistryInboundProcessingLog$RegistryInboundProcessingLogSyncEventListener

[20060412 06:12:10:332] P [MI/Core ] original context restored

[20060412 06:12:10:332] P [MI/Core ] Thread Thread-10 switched context to MI2853484152454429 / 6A685B074963074791DDFEA206AEDB0B (User: (SHARED), MSD: Name: / MOBILEENGINE_JSP (V. 250900), Target=, Type=com.sap.ip.me.core.FrameworkApplicationType) (stack level 1)

[20060412 06:12:10:332] I [MI/API/Sync ] SyncEvent Performing com.sap.ip.me.ccms.LastSuccessfulSyncAlert

[20060412 06:12:10:348] P [MI/Core ] original context restored

[20060412 06:12:10:348] P [MI/Core ] Thread Thread-10 switched context to MI53415054455354 / 5A4D07DB6D29E9418EA6B1436F867E1F (User: SAPTEST, MSD: Name: / MOBILEENGINE_JSP (V. 250900), Target=, Type=com.sap.ip.me.core.FrameworkApplicationType) (stack level 1)

[20060412 06:12:10:348] I [MI/API/Sync ] SyncEvent Performing com.sap.ip.me.apps.jsp.SyncStatus

[20060412 06:12:10:348] P [MI/Core ] original context restored

[20060412 06:12:10:348] P [MI/Core ] Thread Thread-10 switched context to MI53415054455354 / 5A4D07DB6D29E9418EA6B1436F867E1F (User: SAPTEST, MSD: Name: / MOBILEENGINE_JSP (V. 250900), Target=, Type=com.sap.ip.me.core.FrameworkApplicationType) (stack level 1)

[20060412 06:12:10:348] I [MI/API/Sync ] SyncEvent Performing com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager

[20060412 06:12:10:348] P [MI/Core ] Thread Thread-10 switched context to MI53415054455354 / 5A4D07DB6D29E9418EA6B1436F867E1F (User: SAPTEST, MSD: Name: / MOBILEENGINE_JSP (V. 250900), Target=, Type=com.sap.ip.me.core.FrameworkApplicationType) (stack level 2)

[20060412 06:12:10:348] D [MI/Smartsync ] Smart Sync context switch not necessary for same conversation id

[20060412 06:12:10:348] A [MI/Smartsync ] Notifying MessageReplyObservers:

[20060412 06:12:10:348] A [MI/Smartsync ] type: SYNC_BEGIN class: SmartSync Client synchronization start 901 number: 901 text: Start SmartSync Synchronization

[20060412 06:12:10:348] P [MI/Sync ] Begin transaction for outbound containers

[20060412 06:12:10:348] D [MI/Smartsync ] PersistenceAdapterImpl(2): (ConvId = MI53415054455354, Thread = Thread-10) : beginTransaction() isFramework=true

[20060412 06:12:10:348] D [MI/Persistence ] PersistenceManager instance is waiting: 2080726

[End of the file]

after this the Mobile Client simply hangs up,

Former Member
0 Kudos

hi Deepak,

I'm unable to find any abnormality from the trace you have posted. ok, try doing this way - traditional way of debugging - SOP -system.out.println's...

Follow this blog of mine .<a href="/people/arunkumar.ravi/blog/2006/02/22/execute-debug-your-mi-code-from-nwds and Debug your MI Code from NWDS</a>, you may run the code from your NWDS itself and try to debug yourself. i guess you will narrow down on where the problem is.

rgds

Ak.

Former Member
0 Kudos

Thanks Arun, i will try doing that,

would you please tell me one thing,

Do we need to stop the Persistence rum rime before we start synchronization,

because I saw a line of code like

<b>persistenceManager.beginTransaction(true)</b>

do we need to set it to false somewhere.

Please suggest,

Former Member
0 Kudos

hi Deepak,

The "commit" method finalizes a write or delete transaction. Refer <a href="http://media.sdn.sap.com/public/html/submitted%5Fdocs/MI/MDK%5F2.5/">MDK Help</a> for more details.

so, i guess you need to <i>commit</i> somewhere in your code!

Regards

ak.

PS: if my posts help, don't forget my points!

Former Member
0 Kudos

hello deepak,

one confirmation. did you change the persistence parameters

inside the mobileengine.config file such that they will use

your implementations? or is your implementation directly is

only used in your application?

when creating your containers, you can either use the transaction

scope or not... however, if you begin a Tx you should close

it.

from the trace, the PersistenceManger is waiting for something...

try deploying your application into a fresh MI installation.

regards

jo

Former Member
0 Kudos

Hi jo,

No, I dint change any parameter in MobileEngine.config file,

I have all the implementation in the application,

Good news is that problem is almost solved,

Actually as Arun said, we need to close the Tx , so we need to commit at the function which begins transaction,

Thanks for the help arun, jo,

Please keep doing that,

Deepak

Former Member
0 Kudos

Kindly reward useful answers and consider the thread closed if your query is answered.

Regards

Arunkumar

Answers (0)