You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Wolf Benz <eu...@gmail.com> on 2007/01/12 20:29:11 UTC
additional beginners'question about Session
Hi List,
I have, apart from my the mails fromearlier today and yesterday, a
beginner's question about the "Session".
Is, in working with a JCR, the "Session" = a "Connection" object,
like JDO's PersistenceMgr, and Hibernate's Session?
If so, am I right in making these parallel assumptions from JDO:
1/ You don't need a Session object to boot (init, configure) a
Repository, one only needs to configure a SessionFactory.
2/ You don't need to tie a Session to a User. Instead, you'd
typically want to tie a Session to a DAO-unit-of-work.
3/ The Session joins the Transaction, typically started at the JCR
service level (floating above the DAO level)
Thx for help,
Wolf
Re: additional beginners'question about Session
Posted by Wolf Benz <eu...@gmail.com>.
Thanks for your replies/time Jukka. (they prove to be very helpful
for beginners)
Could you elaborate (or, provide a ref/doc, should you have that) on
the below part?
Can I conclude from your reply you'd typically tie a Session to a
User after all if the DAO has to check whether the requested info is
accessible by the user performing the request? In this scenario,
would you typically pass the UserID to the DAO Class where
- a Session is started (in this DAO class)
- the Session is tied to the User (id)
(Or the Sping-equivalent where you'd intercept DAO methods requiring
an ID, to inject these DAO methods with the UserID Spring finds on
this Thread)
Or is there a better JCR-algorithm?
BR,
Wolf
> 2/ You don't need to tie a Session to a User. Instead, you'd
> typically want to tie a Session to a DAO-unit-of-work.
This depend's on your needs. The essential considerations when mapping
sessions to users are access controls and the visibility of transient
changes.
Re: additional beginners'question about Session
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On 1/12/07, Wolf Benz <eu...@gmail.com> wrote:
> Is, in working with a JCR, the "Session" = a "Connection" object,
> like JDO's PersistenceMgr, and Hibernate's Session?
Yes, the essential semantics are the same.
> 1/ You don't need a Session object to boot (init, configure) a
> Repository, one only needs to configure a SessionFactory.
Correct.
> 2/ You don't need to tie a Session to a User. Instead, you'd
> typically want to tie a Session to a DAO-unit-of-work.
This depend's on your needs. The essential considerations when mapping
sessions to users are access controls and the visibility of transient
changes.
> 3/ The Session joins the Transaction, typically started at the JCR
> service level (floating above the DAO level)
Yes.
BR,
Jukka Zitting