You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Khanapurkar, Mona A." <Mo...@idearc.com> on 2007/10/01 06:31:36 UTC

TransientRepository Vs. BindableRepository

Hello,

I would like to have a clear picture of TransientRepository Vs.
BindableRepository. What are their pros and cons? Which one should I use
in what circumstance? Any pointers would help.

Thanks,
Mona

Re: TransientRepository Vs. BindableRepository

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 10/1/07, Khanapurkar, Mona A. <Mo...@idearc.com> wrote:
> Consider two applications deployed to a server that hosts the repository
> configured using BindableRepositoryFactory. Each application gets access
> to the shared repository by the following code:
>
> InitialContext context = new InitialContext();
> Repository  repository = (Repository)context.lookup("jcr/repository");
>
> My question is, do both applications get the same instance of the
> repository? In other words, does BindableRepositoryFactory return same
> instance of the repository to both these applications requesting it?

Yes, that's the typical Model 2 deployment scenario. You just need to
make sure that you configure the JNDI directory entry in one place,
and refer to the same repository name ("jcr/repository" in your case)
in both applications.

BR,

Jukka Zitting

RE: TransientRepository Vs. BindableRepository

Posted by "Khanapurkar, Mona A." <Mo...@idearc.com>.
Thanks for your quick response. 

Consider two applications deployed to a server that hosts the repository
configured using BindableRepositoryFactory. Each application gets access
to the shared repository by the following code:

InitialContext context = new InitialContext();
Repository  repository = (Repository)context.lookup("jcr/repository");

My question is, do both applications get the same instance of the
repository? In other words, does BindableRepositoryFactory return same
instance of the repository to both these applications requesting it?

Thanks,
Mona
 

-----Original Message-----
From: Jukka Zitting [mailto:jukka.zitting@gmail.com] 
Sent: Monday, October 01, 2007 1:44 AM
To: users@jackrabbit.apache.org
Subject: Re: TransientRepository Vs. BindableRepository

Hi,

On 10/1/07, Khanapurkar, Mona A. <Mo...@idearc.com> wrote:
> I would like to have a clear picture of TransientRepository Vs.
> BindableRepository. What are their pros and cons? Which one should I
use
> in what circumstance?

TransientRepository is a simplified Repository entry point, that gives
you default configuration (though you can explicitly override it) and
automatically shuts down the repository when the last session is
closed. TransientRepository is typically used in test or example code,
and sometimes in simple embedded deployments.

BindableRepository is a Repository entry point that can be bound to a
JNDI directory for lookup and use as a shared resource in a J2EE
environment. BindableRepository is typically used in Model 2
deployments in servlet containers.

BR,

Jukka Zitting

Re: TransientRepository Vs. BindableRepository

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 10/1/07, Andrea K. <ak...@alteanet.it> wrote:
> is it (also) right to do that using Repository rather than
> BindableRepository?
>
> Like this:
>
>            InitialContext context = new InitialContext();
>            ...
>            Repository  repository =
> (Repository)context.lookup("jcr/repository");


Correct. In your client code you should try to use the JCR API
interfaces instead of classes from Jackrabbit..

BR,

Jukka Zitting

Re: TransientRepository Vs. BindableRepository

Posted by "Andrea K." <ak...@alteanet.it>.
Hi Jukka,
is it (also) right to do that using Repository rather than
BindableRepository?

Like this:

           InitialContext context = new InitialContext();
           ...           
           Repository  repository =
(Repository)context.lookup("jcr/repository");

Thanks.
BR
Andrea -



Jukka Zitting wrote:
> 
> Hi,
> 
> On 10/1/07, Khanapurkar, Mona A. <Mo...@idearc.com> wrote:
>> I would like to have a clear picture of TransientRepository Vs.
>> BindableRepository. What are their pros and cons? Which one should I use
>> in what circumstance?
> 
> TransientRepository is a simplified Repository entry point, that gives
> you default configuration (though you can explicitly override it) and
> automatically shuts down the repository when the last session is
> closed. TransientRepository is typically used in test or example code,
> and sometimes in simple embedded deployments.
> 
> BindableRepository is a Repository entry point that can be bound to a
> JNDI directory for lookup and use as a shared resource in a J2EE
> environment. BindableRepository is typically used in Model 2
> deployments in servlet containers.
> 
> BR,
> 
> Jukka Zitting
> 
> 

-- 
View this message in context: http://www.nabble.com/TransientRepository-Vs.-BindableRepository-tf4546197.html#a12976287
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: TransientRepository Vs. BindableRepository

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 10/1/07, Khanapurkar, Mona A. <Mo...@idearc.com> wrote:
> I would like to have a clear picture of TransientRepository Vs.
> BindableRepository. What are their pros and cons? Which one should I use
> in what circumstance?

TransientRepository is a simplified Repository entry point, that gives
you default configuration (though you can explicitly override it) and
automatically shuts down the repository when the last session is
closed. TransientRepository is typically used in test or example code,
and sometimes in simple embedded deployments.

BindableRepository is a Repository entry point that can be bound to a
JNDI directory for lookup and use as a shared resource in a J2EE
environment. BindableRepository is typically used in Model 2
deployments in servlet containers.

BR,

Jukka Zitting