Hi!

I have a running JCR. It's in use and creates/updates/removes content when
needed. 

I have another Java project where I need a direct access to the repository. 
I try to connect by this code:

                Repository repository = new 
TransientRepository("target/repository.xml",
"target/");
                Credentials myCredentials = new SimpleCredentials(userName,
                                password.toCharArray());
                try {
                        Session session = repository.login(myCredentials);
                } catch (LoginException e) {
                        e.printStackTrace();
                } catch (RepositoryException e) {
                        e.printStackTrace();
                }

I also changed the relative paths for ${rep.home} and ${wsp.home} in
repository.xml to absolute paths.

It connects to the repository when the other project is not running and I
can access the content of the repository with no problem. But if I first run
the code in 'target' it locks the repository and it's impossible to connect
to the same repository in 'target' from the second project.

I even tried to remove the lock file .lock manually, but it didn't work.



Can anyone help me?


Thanks



--
View this message in context: 
http://jackrabbit.510166.n4.nabble.com/Multiple-accesses-to-a-repository-tp4657670.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Reply via email to