[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread petemuir
iradix wrote : Well, since a session may contain many conversations, then your User object at least has the capability of spanning more than one and that should be factored in. I think an EntityHome might work well for an entity which must be session scoped. View the original post :

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
iradix wrote : I think you're biggest problem is you haven't gotten your head wrapped around the conversational model yet. It definitely takes time and I'd recommend that the first thing you do is at least skim through the Seam reference documentation in it's entirety. I've read the

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread iradix
It does seem that we aren't quite understanding each other. Let me clarify a few points that I think might help you. 1) So I don't confuse things (including myself) I'm going to pretend that Persistence Context and Entity Manager mean the same thing. @PersistenceContext(type=EXTENDED) does

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
Okay, that makes a lot more sense to me. However, things still don't seem to be working quite the way you describe. Here's my newly reworked code, using two generic beans, Parent and Child. Parent bean... | package sample.model.pc; | | import java.util.List; | | import

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
The above is an example of why not to post when you're frustrated. Stupid not closing the quote tag properly. :( View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3984198#3984198 Reply to the post :

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread iradix
1) You are outjecting your parent without an explicit scope, I can't remember the rules but I think an entity will default to event. 2) No, I would say that mixing and matching the two is not a good idea. I can't say for sure why your em isn't injecting properly, but play around with it. It

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
iradix wrote : 1) You are outjecting your parent without an explicit scope, I can't remember the rules but I think an entity will default to event.[/quote | | I thought outjection observed the entities scope. In this case, Parent is annotated with @Scope(ScopeType.SESSION) | | iradix

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
Actually though, the debug page shows that the Parent is in the session context. It's just not getting injected into the ChildListBean correctly. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3984202#3984202 Reply to the post :

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread iradix
From the docs anonymous wrote : By default, entity beans are bound to the conversation context. They may never be bound to the stateless context. The scope specified in the bean is the scope it will be outjected to if it is created through seam (i.e. @In(create = true)). When using @Out the

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
Doh... I really am an r-tard. Yeah, I forgot to annotate ChildListBean with @Interceptors(SeamInterceptor.class) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3984209#3984209 Reply to the post :

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread [EMAIL PROTECTED]
But that stuff in ejb-jar.xml, don't use the @Interceptors annotation anymore, its ugly. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3984213#3984213 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3984213

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
Okay... so why doesn't this work... First I create a parent and outject it to the Session context... View... | h:form | table | tr | tdName:/td | tdh:inputText value=#{newParent.name}//td | /tr | tr | tdSubmit:/td

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bpatters
I don't see you creating the child anywhere and merging it into the entitymanager. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3984237#3984237 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3984237

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread iradix
Your on the right track, now you're starting to get how the EM works and it's time to bone up on your hibernate docs. Look into how collections are handled. A tip, you can't set a new List into your object after it's retrieved. View the original post :

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
See, this still leaves some key questions unanswered. 1) I've updated my ChildActions thusly... | @In @Out | Parent parent; | | @Begin | public String preCreateChild() | { | parent = parentActions.getParent(parent.getId()); | return

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread iradix
It doesn't need to be done. You have to merge your child because it was retrieved before you began your conversation. If not, it wouldn't be available to pass into your method annotated with @Begin. If you are conscious of your conversation lifecycle and the fact that your persistence

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread bkyrlach
Well, thanks for all your help. I guess I'll go read more documentation. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3984317#3984317 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3984317

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-08 Thread iradix
No problem. It's frustrating at first, but once you get the feel for thinking about things in terms of conversations it can make many complicated tasks much easier (in my opinion at least). View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3984320#3984320 Reply

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread [EMAIL PROTECTED]
If you are really carefully, and really understand the memory management implications and really know what you are doing, you can make this work. But in most cases it is dangerous. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3983828#3983828 Reply to the

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread [EMAIL PROTECTED]
This is a completely backwards way of looking at this. The pattern for Seam is persistence-context-per-transaction or persistence-context-per-conversation. If you want anything else, you don't have to figure out what breaks, but WHY you would want anything else. What are the advantages of

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread bkyrlach
Gavin... Then I guess you're saying for me, this is a really bad idea. :) Christian... I dunno. I guess to me it just seems somewhat backwards to have to always be merging your entities and/or doing a query before every update. Especially when the documentation for merge suggests that it's

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread [EMAIL PROTECTED]
You want persistence-context-per-conversation. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3983874#3983874 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3983874 ___ jboss-user

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread bkyrlach
Not really. I'm using that now, and I'm still ending up doing merging and funky stuff to make everything Just Work(tm)(c)(pp). Here's some (poorly written, tbh) code to illustrate... I have a user... @Entity @Name(user) @Scope(ScopeType.SESSION) @Role(name=newUser, scope=ScopeType.EVENT)

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread [EMAIL PROTECTED]
I can't read that code. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3983889#3983889 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3983889 ___ jboss-user mailing list

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread bkyrlach
(reposted using an updated understanding of code-blocks... :( Not really. I'm using that now, and I'm still ending up doing merging and funky stuff to make everything Just Work(tm)(c)(pp). Here's some (poorly written, tbh) code to illustrate... I have a user... | package sample.model;

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread iradix
With a proper cascade on the activities list stored within the user, you should be able to just bind the values that are editable via the value attribute of each JSF component. After they are validated and the model is updated (i.e. new values are set on each appropriate activity) saving the

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread bkyrlach
Before I argue with you I want to point out that I like your solution. My argument is just me trying to understand more of what you're saying. iradix wrote : With a proper cascade on the activities list stored within the user, you should be able to just bind the values that are editable via the

[jboss-user] [JBoss Seam] - Re: EntityManger-per-user-session...

2006-11-07 Thread iradix
I think you're biggest problem is you haven't gotten your head wrapped around the conversational model yet. It definitely takes time and I'd recommend that the first thing you do is at least skim through the Seam reference documentation in it's entirety. That being said, I'll try to explain