AnsweredAssumed Answered

How to restart the repository session

Question asked by ethan on Sep 13, 2010
Latest reply on Sep 22, 2010 by ethan
Hi :)

I'm trying to add some nodes to the Alfresco Repository. I iterate through a tree and copy each nodes and their children into the Alfresco repository. Sometimes, an exception is thrown (like DuplicateChildNameException). I used a try catch for each node and I would like that when an exception is thrown, the current node would be ignored and the iterator continue to do its work.

The problem is when an Exception is thrown, the session doesn't work anymore. There is an error message for each following nodes. Something like "the transaction has already been rolled back".

I tried to logout from the session but it threw an illegalStateException. I tried to reconnect to the repository with the same session variable (sessionALF = repository.login(myCredentials);) but it threw an exception with the following message: "only one session is allowed per thread".

Do you have an idea about what I should do?

Thank you :)

Outcomes