You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by woolly <p....@lbs-ltd.com> on 2007/06/08 12:59:38 UTC

Only one Session Per Workspace ? And why the workspace.xml?

Hi all,

I'm currently evaluating JackRabbit for use in an application. I've come
across a problem - you're only allowed one session per workspace at any one
time. If I have 100's of users trying to access this workspace, I'm going to
have to force them to queue for their access to the repository. Surely this
is a pretty major problem? I feel I must be missing something here but can't
figure it out...

Also, I've been trying to get everything stored in an Oracle database. Is it
possible to have this so that NO files at all are created on the local
filesystem?

Thanks for any help and advice.

Phil.
-- 
View this message in context: http://www.nabble.com/Only-one-Session-Per-Workspace---And-why-the-workspace.xml--tf3889091.html#a11024393
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Only one Session Per Workspace ? And why the workspace.xml?

Posted by woolly <p....@lbs-ltd.com>.
Is it necessary to have a workspace.xml for each workspace I create? In my
application I'm going to be managing documents that are grouped into
"projects". I was thinking of having each workspace represent a project,
with it's own particular nodetypes etc. I don't want to have to manage
potentially 100's of workspace.xml files though. Is there another way of
configuring workspaces?

Thanks for all your comments so far.

Phil.
-- 
View this message in context: http://www.nabble.com/Only-one-Session-Per-Workspace---And-why-the-workspace.xml--tf3889091.html#a11056917
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Only one Session Per Workspace ? And why the workspace.xml?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 6/8/07, woolly <p....@lbs-ltd.com> wrote:

> ...Is there a way to connect to a repository that is already "open"
> without having a reference to the "repository" object?..

no, you need that object.

> ...Perhaps that doesn't matter, for now I'm only testing but later on I'll have
> the repository running on JBoss, so I assume I'll access the repository
> through JNDI ?...

Yes, that's one way, or see the j2ee package in the jackrabbit-webapp
module, or the new jackrabbit-jcr-servlet module. Any singleton-like
mechanism will do.

-Bertrand

Re: Only one Session Per Workspace ? And why the workspace.xml?

Posted by woolly <p....@lbs-ltd.com>.
In that case then, I think the reason my app won't start up twice is because
I'm doing this..

repository = new TransientRepository();
session = repository.login(new SimpleCredentials(username,
"".toCharArray()));
nodeRoot = session.getRootNode();

...at the beginning. I assume that calling new TransientRepository() tries
to set up a new repository in a place where one already exists and it gets
upset. Is there a way to connect to a repository that is already "open"
without having a reference to the "repository" object? 
Perhaps that doesn't matter, for now I'm only testing but later on I'll have
the repository running on JBoss, so I assume I'll access the repository
through JNDI ?

Thanks for your advice.


Bertrand Delacretaz wrote:
> 
> On 6/8/07, woolly <p....@lbs-ltd.com> wrote:
>> ....I thought you could only have one session per workspace because of
>> this:
>> http://www.onjava.com/pub/a/onjava/2006/10/04/what-is-java-content-repository.html?page=3
>> ...where it says, "Please note that there is a one-to-one mapping between
>> session and workspace"....
> 
> This is slightly misleading: although one Session points to a single
> workspace, several Sessions can indeed be connected to the same
> workspace.
> 
> -Bertrand
> 
> 

-- 
View this message in context: http://www.nabble.com/Only-one-Session-Per-Workspace---And-why-the-workspace.xml--tf3889091.html#a11029694
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Only one Session Per Workspace ? And why the workspace.xml?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 6/8/07, woolly <p....@lbs-ltd.com> wrote:
> ....I thought you could only have one session per workspace because of this:
> http://www.onjava.com/pub/a/onjava/2006/10/04/what-is-java-content-repository.html?page=3
> ...where it says, "Please note that there is a one-to-one mapping between
> session and workspace"....

This is slightly misleading: although one Session points to a single
workspace, several Sessions can indeed be connected to the same
workspace.

-Bertrand

Re: Only one Session Per Workspace ? And why the workspace.xml?

Posted by woolly <p....@lbs-ltd.com>.
Hi Stefan, thanks for replying...


>> that's not correct. what leads you to this assumption?
> 
I thought you could only have one session per workspace because of this:
http://www.onjava.com/pub/a/onjava/2006/10/04/what-is-java-content-repository.html?page=3
...where it says, "Please note that there is a one-to-one mapping between
session and workspace".

Also, when I run my trial application twice i get the error....

The repository home at C:\Development\JAVA\Eclipse\JCRTrial\repository
appears to be in use since the file at
C:\Development\JAVA\Eclipse\JCRTrial\repository\.lock is locked by another
process.

...although having looked at it I am using the same authentication details
each time so i'll try with different authentication details.


>> you can e.g. specify an OracleFileSystem for the repository and
>> workspaces.
>> everything except the lucene index files would be stored in your oracle
>> db.
> 
In my repository.xml I specify OracleFileSystem and OraclePersistenceManager
for everything but it still creates a repository directory and the file
repository\workspaces\default\workspace.xml. Is that necessary? Also, would
it be possible to store the indexes in the database?
My repository.xml is attached:
http://www.nabble.com/file/p11026561/repository.xml repository.xml 

Thanks again.

Phil.
-- 
View this message in context: http://www.nabble.com/Only-one-Session-Per-Workspace---And-why-the-workspace.xml--tf3889091.html#a11026561
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Only one Session Per Workspace ? And why the workspace.xml?

Posted by Stefan Guggisberg <st...@gmail.com>.
hi phil

On 6/8/07, woolly <p....@lbs-ltd.com> wrote:
>
> Hi all,
>
> I'm currently evaluating JackRabbit for use in an application. I've come
> across a problem - you're only allowed one session per workspace at any one

that's not correct. what leads you to this assumption?

> time. If I have 100's of users trying to access this workspace, I'm going to
> have to force them to queue for their access to the repository. Surely this
> is a pretty major problem? I feel I must be missing something here but can't
> figure it out...
>
> Also, I've been trying to get everything stored in an Oracle database. Is it
> possible to have this so that NO files at all are created on the local
> filesystem?

you can e.g. specify an OracleFileSystem for the repository and workspaces.
everything except the lucene index files would be stored in your oracle db.

cheers
stefan

>
> Thanks for any help and advice.
>
> Phil.
> --
> View this message in context: http://www.nabble.com/Only-one-Session-Per-Workspace---And-why-the-workspace.xml--tf3889091.html#a11024393
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>