This content has been marked as final.
Show 5 replies
-
1. Re: The scope of Seam-managed Hibernate Session
gavin.king Oct 13, 2006 12:03 AM (in response to littlesuns)What you inject something into does not affect its lifecycle. Note that in Seam "injection" is a very transient thing that lasts only for a single method call.
-
2. Re: The scope of Seam-managed Hibernate Session
littlesuns Oct 13, 2006 2:44 AM (in response to littlesuns)Thank you for your answer,Gavin.
if I hava a Seam component ActionA like that:@Scope(ScopeTypw.CONVERSATION) public class ActionA{ //seam-managed hibernate session @In(create=true) private Session s; }
when we invoke a method of ActionA,there will be a Session s injected,but the managed Session has its own scope as a component,what I want to know is not when the Session inject,I want to know when the injected Session will be destryed,because the Session is controled by Seam and the Scope of Conversation is not a "Exact" concept,BTW,the managed session is a Converstaion Scope,it is mean that we will (or could) have many exist Sessions if every Action inject a hibernate Session,am I right? -
3. Re: The scope of Seam-managed Hibernate Session
gavin.king Oct 13, 2006 11:58 AM (in response to littlesuns)No no no!
There is at most one Session named "s" for each conversation, and it is destroyed when the conversation ends.
Are you sure you really understand what a conversation is? -
4. Re: The scope of Seam-managed Hibernate Session
littlesuns Oct 13, 2006 9:41 PM (in response to littlesuns)thank you for your reply;
I think now I have known how it work a little,the managed-session and the ActionA have their own lifecycle,when the ActionA needs a Session "s",a managed-session in the ConversationContext will be injected into the ActionA,and the managed-session will be destroyed when its own lifecycle end,right? -
5. Re: The scope of Seam-managed Hibernate Session
gavin.king Oct 13, 2006 9:55 PM (in response to littlesuns)Right.