You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Rakesh Vidyadharan <ra...@sptci.com> on 2010/02/13 19:25:04 UTC

What are workspaces?

I was playing around with workspaces and ran into unexpected behaviours.  It seems that regardless of the workspace my session is bound to, I see the same set of nodes (using same credentials).  I created the workspace with just name (without option to clone an existing workspace), then got a session to the newly created workspace expecting no nodes (other than system generated ones), but was surprised to see the exact same nodes as I usually see with the default workspace.  I then switched to the security workspace and saw the same data.

I tried putting some debug information on each node to ensure that the node's session was indeed bound to the workspace I wanted, and that part looks fine (at this point I believe it is not my code issue).

Any explanations on this would be most welcome...

Thanks
Rakesh

Re: What are workspaces?

Posted by ChadDavis <ch...@gmail.com>.
I think alot of people find the concept of workspaces a bit
challenging.  I certainly did.  Mostly due to misconceptions.  I kept
thinking of it as something akin to a RDBMS schema; a user's section
of the db with all of their related data structures.  However,
workspaces are nothing like this.

To me, the best way to understand them is to think of the JCR repo as
if you were writing a version control system.  In CVS, for example,
the repo has a virtual set of the files.  Each user can check out a
state of those files into their own "workspace", where they can make
changes to those files and even later merge those files back into the
whole.  I hope this helps a bit.

Also, the specification is quite informative and worth reading closely.

On Sat, Feb 13, 2010 at 11:25 AM, Rakesh Vidyadharan <ra...@sptci.com> wrote:
> I was playing around with workspaces and ran into unexpected behaviours.  It seems that regardless of the workspace my session is bound to, I see the same set of nodes (using same credentials).  I created the workspace with just name (without option to clone an existing workspace), then got a session to the newly created workspace expecting no nodes (other than system generated ones), but was surprised to see the exact same nodes as I usually see with the default workspace.  I then switched to the security workspace and saw the same data.
>
> I tried putting some debug information on each node to ensure that the node's session was indeed bound to the workspace I wanted, and that part looks fine (at this point I believe it is not my code issue).
>
> Any explanations on this would be most welcome...
>
> Thanks
> Rakesh

Re: What are workspaces?

Posted by Rakesh Vidyadharan <ra...@sptci.com>.
On 15 Feb 2010, at 05:26, Alexander Klimetschek wrote:

> On Sat, Feb 13, 2010 at 19:25, Rakesh Vidyadharan <ra...@sptci.com> wrote:
>> I was playing around with workspaces and ran into unexpected behaviours.  It seems that regardless of the workspace my session is bound to, I see the same set of nodes (using same credentials).  I created the workspace with just name (without option to clone an existing workspace), then got a session to the newly created workspace expecting no nodes (other than system generated ones), but was surprised to see the exact same nodes as I usually see with the default workspace.  I then switched to the security workspace and saw the same data.
> 
> This is weird. Was it your custom nodes that you saw in both workspaces?
> 
> Maybe your repository configuration (<Workspace> template in
> repository.xml) is somewhat broken and lets all workspaces point to
> the same directory / db tables / etc. Could you post the
> repository.xml and workspace.xml files?
> 
> Regards,
> Alex


Thanks for the pointer to the solution.  It was indeed the workspaces sharing the same database.  I had (probably copy paste error) in repository.xml under Workspace

<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
      <param name="url" value="jdbc:derby:${rep.home}/db;create=true" /> </PersistenceManager>

Thanks
Rakesh


Re: What are workspaces?

Posted by Alexander Klimetschek <ak...@day.com>.
On Sat, Feb 13, 2010 at 19:25, Rakesh Vidyadharan <ra...@sptci.com> wrote:
> I was playing around with workspaces and ran into unexpected behaviours.  It seems that regardless of the workspace my session is bound to, I see the same set of nodes (using same credentials).  I created the workspace with just name (without option to clone an existing workspace), then got a session to the newly created workspace expecting no nodes (other than system generated ones), but was surprised to see the exact same nodes as I usually see with the default workspace.  I then switched to the security workspace and saw the same data.

This is weird. Was it your custom nodes that you saw in both workspaces?

Maybe your repository configuration (<Workspace> template in
repository.xml) is somewhat broken and lets all workspaces point to
the same directory / db tables / etc. Could you post the
repository.xml and workspace.xml files?

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com