[EJB 3.0] - Re: Detach entities - Obtaining a clear pojo
by fatbatman
I also need to obtain a completely clean Pojo.
I currently serialise detached entities then send them over a network to a remote client which is an applet that has no concept of EJB3 (no ejb jars on classpath). Here the client treats them as Pojos.
When running a full round trip unit test in which a detached obj is sent to the client, if a field/association is not initialised then I want a null value, not a LazyInitialisationException. But because in the test case the client and server are both run within the same JVM I get a LazyInitialisationException.
If I was able to get a completely clean Pojo, this wouldn't happen.
Is there some standard way of doing this? like a;
Object getCompletelyDetachedClone(obj) method?
thanks in advance
James
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969090#3969090
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969090
19 years, 7 months
[JBoss Seam] - ConversationEntry -- Should lastRequestTime equal startTime
by raja05
When a conversation is created, the ConversationEntry object has the starttime equal to the current time and the lastRequesttime set to 0. Should the lastRequestTime be also initialized to the current time stamp? Here is why Im asking this.
In my application, I start a conversation on a Stateful bean and all Im doing there is displaying the view. A ConversationEntry is created at this point of time. The view has a #{categories} which is a @Factory and it initializes the categories Array. The problem is that this variable(and the rest of them) are not stored during the next request in the conversation. This is because the afterPhase calls Manager.instance().conversationTimeout after the view is rendered and this basically deletes the conversationentry. The logic to delete the conversationentry works for a regular timeout but in this case, the conversation creation has just happened(during the render response phase). If we set the lastREquestTime to be the same as the current time, then the difference(currentime - lastRequesttime) will be less than the conversation timeout and the entry will not be deleted.
im not sure if im explaining my case clearly, but if its not, please ask me for more information.
Thanks
Raja
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969086#3969086
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969086
19 years, 7 months