[JBoss Seam] - Re: New User Lazy Load Question
by christian.bauer@jboss.com
If you load a User instance into the Session context it becomes _detached_ from the persistence context, by definition (the persistence context has a smaller scope, Conversation or Event).
So if you want to access unloaded associations or collections on that User instance you need to _reattach_ it or _merge_ it into a new persistence context at the time you want to initialize associations or collections. This means you need to pass the instance into the entityManager.merge(user) method, then take the return value and access your collection there.
I recommend that you instead:
a) do not access the collection of the User instance in the Session but instead put the "currentPhoneNumbers" list into the Session as well and access it directly
b) map the one-to-many with EAGER fetching so the collection is loaded right away when the User is loaded
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083299#4083299
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083299
18 years, 7 months
[JBoss Portal] - Re: Creating a CMS interceptor
by frontline
I tried a different approach to this by dynamically adding interceptors to the stack.
I can get a reference to the InterceptorFactory object and list the two default interceptors in it.
But how can I add interceptors?
The addInterceptor() method is located in the class JBossInterceptorStackFactory, but how can I get an instance of this?
If I try to cast the InterceptorFactory I got it throws a ClassCastException, because it is of type "$proxy242".
The class show this when I print it:
"MBeanProxyExt[portal:service=InterceptorStackFactory,type=Cms], $Proxy242"
I get the object using the following (which seems to be working when using the interface and not the implementation class):
MBeanServer server = MBeanServerLocator.locate();
| m_mbeanProxy = MBeanProxyExt.create(m_proxyInterface, m_objectName, server);
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083298#4083298
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083298
18 years, 7 months
[JBoss Messaging] - Re: JMSMessageID in Messaging cluster
by beve
Hi Clebert,
anonymous wrote :
| One thing we could do easily (it is implemented this way now on trunk) is set the CorrelationID when the message is transfered over the cluster. Would that be okay for you?
|
I think that the JMSCorrelationID should always travel with the Message over the cluster as it is set by applications, but I think that this what you mean. This currently works with JBM1.3 and JBM1.4 and we will change the default behaviour for the ESB to always set the outgoing correlation id. We were previously using the second pattern mentioned in aslak's post (setting the correlation id to the message id).
I do think that the message id should not be changed in the cluster but if this will be the case in a later release then that's fine.
Thanks for your help!
/Daniel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083292#4083292
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083292
18 years, 7 months