[EMFStore] Working with multiple usersessions [message #1440805] |
Wed, 08 October 2014 18:24  |
Eclipse User |
|
|
|
I need to be able to switch between the current user and my hardcoded admin user in a procedure. I need to use my hardocded user to access that project and make commits .
My implementation psudocode is :
myUserSession = server.login("myuser", "mypass")
findProjectX(myusersession, server){
-check if project X is checked out in local and return it
-else check out the project X from server with myusersession
}
Add new fdata to project X
projectX.commit()
This works if every time I open the workspace I checkout the project. However, when I reopen the same workspace that has this project, on the commit XMLRPC gives this error:
Root exception:
org.eclipse.emf.emfstore.internal.server.exceptions.UnknownSessionException: Session unknown to Connection manager, log in first!
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.AbstractConnectionManager.getConnectionProxy(AbstractConnectionManager.java:69)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.xmlrpc.XmlRpcConnectionManager.createVersion(XmlRpcConnectionManager.java:108)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController$2.run(CommitController.java:227)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController$2.run(CommitController.java:1)
at org.eclipse.emf.emfstore.internal.client.common.UnknownEMFStoreWorkloadCommand$1.call(UnknownEMFStoreWorkloadCommand.java:73)
What do I need to do to avoid this problem?
|
|
|
|
|
|
|
Re: [EMFStore] Working with multiple usersessions [message #1446804 is a reply to message #1446430] |
Fri, 17 October 2014 06:35  |
Eclipse User |
|
|
|
Hi Roza,
can you please check two things:
1) Before doing locProject.getUsersession().refresh(), what is
isSavePassword() returning for that userssession? Also note down the
ESSessionId via getSessionId().
2) When doing the commit, are you absolutely that you are doing the
commit with the session you refreshed before (compare the ESSessionId of
the session you want to perform the commit with, with the ones you noted
down when you've refreshed the session)?
Is this problem probably related to the one you already mentioned
yesterday, i.e. the behaviour of EMFStoreClientUtil that currently
always creates new sessions instead of reusing the existing ones?
Cheers,
Edgar
> I just loop through local project
>
>
> for (ESLocalProject locProject: esWs.getLocalProjects()){
> if (locProject.getProjectName().equals(TAG_PRJ_NAME)){
>
> locProject.getUsersession().refresh();
>
> if (locProject.hasUncommitedChanges())
> locProject.revert();
> locProject.update(subMontiro.newChild(1));
> return locProject;
>
> }
>
> }
>
> And later on in the code I make changes and call, locProject.commit and
> that's when I am getting the exception.
--
Edgar Mueller
Get Professional Eclipse Support: http://eclipsesource.com/munich
|
|
|
Powered by
FUDForum. Page generated in 0.14161 seconds