[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-27 Thread SmokingAPipe
Ok, what I am doing is I am using a SFSB (temp. conversation scope) to act as an intermediary when needed, and it's working fine (of course) and it's not cumbersome or unnatural. I'll use a real conversation bean (with Begin and End) when I come to some part like building up a complex report

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-27 Thread [EMAIL PROTECTED]
I'm not a persistence expert - so you'll probably want to ask Gavin when he gets back. In general I try to be careful about session-level data. Sessions generally live a long time, and session data can easily go stale. (a search result, or something) You'll often find that the best

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-27 Thread [EMAIL PROTECTED]
On the facelets question, remember that the ultimate goal of any view technology in JSF is to produce a UI model. In the JSP case, you have a JSP which generates a .java, compiles to a .class. The servlet is then loaded into to memory. When a request comes in, the servlet excutes and

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-27 Thread SmokingAPipe
I now have Facelets working and am moving pages over from JSP-style % include(... to using proper Facelet Templates. I have look at various template systems (both Java and PHP) and this one is the best. It produces well-formed output every time and lets me easily define a real page template

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-27 Thread [EMAIL PROTECTED]
The templating engine is great, but just wait until you get to writing custom components. Facelets makes custom components SO much simpler because you don't have to write a tag library - you just write your custom component and go. Facelets isn't without it's warts - I was banging my head

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread SmokingAPipe
Ok, I found out a little bit more. I looked at the docs for SeamExtendedManagedPersistencePhaseListener. It says Deprecated. use TransactionalSeamPhaseListener. I took out the SeamExtendedManagedPersistencePhaseListener and replaced it with TransactionalSeamPhaseListener in my

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread [EMAIL PROTECTED]
Yes, it works. It's just a new name. Are you using a seam managed persistence context? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3996358#3996358 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996358

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread SmokingAPipe
[EMAIL PROTECTED] wrote : Yes, it works. It's just a new name. Are you using a seam managed persistence context? Yes, definitely. Here's the scenario, which is just like basically every other web application on the planet: A user goes to a login-page, logs in, the User object is stored in

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread hstang
You need an extended conversation context. Use @Begin in your source or s:link propagation=begin to begin a conversation. An SMPC will be setup in the conversation context where you would be able to avoid LIE, for that particular conversation. Seam's debug page (i.e. debug.seam) is helpful.

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread hstang
After re-reading your post, I may think you might not require an extended conversation context if it's a simple action. What happens if you try to access createCustomer object instead of customer object during the render phase (i.e. facelets .xhtml) ? As well you said that the customer object

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread hstang
Glad that it work out well for you. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3996367#3996367 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3996367 ___ jboss-user mailing list

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread SmokingAPipe
Ah, that is indeed the problem. SMPC is CONVERSATION scoped, not SESSION scoped. I need to get that customer object into a conversation, which I will probably do with a @Begin method on the link. Easy to do. Wow that really tripped me up. Now I'm going to try that, but it seems obviously

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread [EMAIL PROTECTED]
Just to lend some flavor to this, the key points are that to avoid a LIE, an entity has to be attached to an active persistence context and there has to be a be an active transaction. The seam managed persistence context is one that has it's lifecycle associated with a conversation. As long

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread SmokingAPipe
[EMAIL PROTECTED] wrote : I assume the reason you were failing is that your PC was not in long-running conversation. Right, that is the problem. I load the customer into the session-scope, and that works. Now I want to display some collections that are referenced by the customer object on

[jboss-user] [JBoss Seam] - Re: Getting LazyInitializationErrors with a SMPC

2006-12-26 Thread SmokingAPipe
Oh, another thing I noticed, according to: http://docs.jboss.com/seam/1.1GA/reference/en/html/xml.html, I can create a session-scoped SMPC, but it says: This example creates a session-scoped Seam-managed persistence context (this is not recommended in practice):. It seems like the