  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Removing EJB Business Delegate | Removing EJB Business Delegate 2004-02-25 - By ashraf galal
Back <html><div style='background-color:'><P>I agree with you that subject is no longer related to the pattern.</P> <P>But I have one more comment. because I think you speak about entity bean not session.</P> <P>from the definition of the sessio bean: <BR></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT face="Times New Roman" size=2>Session beans</FONT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT size=2><FONT face="Times New Roman"><SPAN style="mso-tab-count: 1"> </SPAN>Exists for the duration of an interaction between a client application and an application server.</FONT>< /FONT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT size=2><FONT face="Times New Roman"><SPAN style="mso-tab-count: 1"> </SPAN>The data of a session bean is not stored in a database.</FONT></FONT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT size=2><FONT face="Times New Roman"><SPAN style="mso-tab-count: 1"> </SPAN>Session beans can be either stateless or stateful. </FONT></FONT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT size=2><FONT face="Times New Roman"><SPAN style="mso-tab-count: 1"> </SPAN>A stateless session bean does not maintain any state between method calls and can process requests from multiple client applications.</FONT></FONT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT size=2><FONT face="Times New Roman"><SPAN style="mso-tab-count: 1"> </SPAN>A stateful session bean maintains conversational state between method calls and can process requests from a single client application. </FONT></FONT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT face="Times New Roman" size=2></FONT>  ;</P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; DIRECTION: ltr; unicode -bidi: embed; TEXT-ALIGN: left"><FONT face="Times New Roman" size=2>I agree with Sean that the container manage the llife cycle of the bean. </FONT></P> <P><BR> </P><BR><BR><BR> <DIV>Ashraf Galal <BR>(416)804-8359</DIV>>From: James Telfer <JT@(protected) .COM.AU>>Reply-To: An interest list for Sun Java Center J2EE Pattern Catalog <J2EEPATTERNS-INTEREST@(protected)>>To: J2EEPATTERNS-INTEREST@(protected) >Subject: Re: Removing EJB Business Delegate >Date: Thu, 26 Feb 2004 14:30 :55 +1030 > >The remove() method on a session bean signals to the container that you have >no further use for the calling instance. In the case of a stateless bean >this method is not that useful, however in the case of a stateful bean it >allows the container to release resources earlier than it otherwise would. >Stateful beans that do not have remove() called on them will be freed on >session timeout, avoiding the resource leak you allude to. > >Feel free to take this discussion up with me off list; I'm not sure that >this is pattern-based any longer. > >JT > >-- ---Original Message-- -- >From: Arzamasov Alexey [mailto:A Arzamasov@(protected)] >Sent: Thursday, 26 February 2004 14:22 >To: J2EEPATTERNS-INTEREST@(protected) >Subject: Re: Removing EJB Business Delegate > > >On Thursday 26 February 2004 09:41, Sean Brydon wrote: > > > The EJB container maintains controls the lifecycle of session beans, so > > you do not need to call remove. It will create them and destroy them as > > needed. This is a nice feature of EJB containers since you are free to > > focus on the application business logic and let the conainer manage the > > object lifecycle. > > > > On entity beans you would call remove if you want to remove some data > > from the database. > >I guess that one should call remove() on statefull session bean to signal to >container that this bean can be removed and do not need to be passivated. >I guess that not calling remove() will cause container to hold my statefull >session bean forever. >Is it wrong? &g t; >==================================================================== >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints: http:/ /java.sun.com/blueprints/corej2eepatterns >List Archive: http://archives.java .sun.com/archives/j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) </div><br clear=all><hr>Add photos to your e-mail with <a href="http://g.msn.com/8HMBENCA/2746??PS=">MSN 8 . </a> Get 2 months FREE*. </html> ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |