<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Why does javax.ejb.EnterpriseBean extends java.io.Serializable?</title>
	<atom:link href="http://madbean.com/2003/mb2003-13/feed/" rel="self" type="application/rss+xml" />
	<link>http://madbean.com/2003/mb2003-13/</link>
	<description>Your zero step program</description>
	<pubDate>Sat, 22 Nov 2008 07:13:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: M.Alfred Mathavan</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-22</link>
		<dc:creator>M.Alfred Mathavan</dc:creator>
		<pubDate>Mon, 27 Oct 2003 07:03:16 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-22</guid>
		<description>&lt;p&gt;The data Storage may be in a different computer and the EJB Enterprise Tier may be in a different computer so during passivation and activation the data need to travell via network to the EIS tier hence the object should be serialized.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The data Storage may be in a different computer and the EJB Enterprise Tier may be in a different computer so during passivation and activation the data need to travell via network to the EIS tier hence the object should be serialized.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Quail</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-21</link>
		<dc:creator>Matt Quail</dc:creator>
		<pubDate>Sat, 29 Mar 2003 11:46:37 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-21</guid>
		<description>&lt;p&gt;OJB put me on to this non-answer from a year ago:&lt;/p&gt;

&lt;p&gt;http://www.mail-archive.com/ejb-interest@java.sun.com/msg21279.html&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>OJB put me on to this non-answer from a year ago:</p>
<p><a href="http://www.mail-archive.com/ejb-interest@java.sun.com/msg21279.html" rel="nofollow">http://www.mail-archive.com/ejb-interest@java.sun.com/msg21279.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver Burn</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-20</link>
		<dc:creator>Oliver Burn</dc:creator>
		<pubDate>Thu, 27 Mar 2003 08:38:42 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-20</guid>
		<description>&lt;p&gt;The EJB spec talks a lot about the life-cycle of an EJB. It does not talk about when an EJB is serialized. Therefore you can make no assumptions about when an EJB is serialized and de-serialized. If you need to store attributes then in an MDB or SLSB you would need to do this yourself.&lt;/p&gt;

&lt;p&gt;I personally think there is no obvious answer. It probably goes back to early EJB 1.0 days, and now they do not want to remove the interface and break a (mythical) contract.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The EJB spec talks a lot about the life-cycle of an EJB. It does not talk about when an EJB is serialized. Therefore you can make no assumptions about when an EJB is serialized and de-serialized. If you need to store attributes then in an MDB or SLSB you would need to do this yourself.</p>
<p>I personally think there is no obvious answer. It probably goes back to early EJB 1.0 days, and now they do not want to remove the interface and break a (mythical) contract.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bjd</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-19</link>
		<dc:creator>bjd</dc:creator>
		<pubDate>Thu, 27 Mar 2003 04:39:55 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-19</guid>
		<description>&lt;p&gt;Even though you do not normally store the attributes of stateless Session EJBs and
MDBs, you might want the ability to do so, therefore you must have java.io.Serializable in place.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Even though you do not normally store the attributes of stateless Session EJBs and<br />
MDBs, you might want the ability to do so, therefore you must have java.io.Serializable in place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Quail</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-18</link>
		<dc:creator>Matt Quail</dc:creator>
		<pubDate>Wed, 26 Mar 2003 22:28:58 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-18</guid>
		<description>&lt;p&gt;Thomas, I agree that bean &lt;em&gt;remote interfaces&lt;/em&gt; definitely need to be serializable; it is required because they are Remote; eg so that they can be passed-as-arguments/returned-as-valued to/from remote methods.&lt;/p&gt;

&lt;p&gt;But EnterpriseBean is not for the &lt;em&gt;remote interface&lt;/em&gt;, its for the &lt;em&gt;bean implementation&lt;/em&gt; classes. Instances of those DO NOT get passed around from remote methods; those instances remain &#34;nice and snug&#34; inside the EJB container. That is, EJB impls do not get marshalled during remote calls, just their remote interfaces.&lt;/p&gt;

&lt;p&gt;Stateless SB's implementation instances don't get marshalled during calls either... but they &lt;em&gt;may&lt;/em&gt; get serialized during activation/passivation.&lt;/p&gt;

&lt;p&gt;So, once again, I'm left wondering why an Entity EJB is serializable... is the bean implementer required to think about if their class is properly serializable? Will an Entity EJB be passivated before a container &#34;serializes&#34; it... or will an Entity EJB &lt;em&gt;NEVER&lt;/em&gt; be serialized by the container...?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thomas, I agree that bean <em>remote interfaces</em> definitely need to be serializable; it is required because they are Remote; eg so that they can be passed-as-arguments/returned-as-valued to/from remote methods.</p>
<p>But EnterpriseBean is not for the <em>remote interface</em>, its for the <em>bean implementation</em> classes. Instances of those DO NOT get passed around from remote methods; those instances remain &quot;nice and snug&quot; inside the EJB container. That is, EJB impls do not get marshalled during remote calls, just their remote interfaces.</p>
<p>Stateless SB&#8217;s implementation instances don&#8217;t get marshalled during calls either&#8230; but they <em>may</em> get serialized during activation/passivation.</p>
<p>So, once again, I&#8217;m left wondering why an Entity EJB is serializable&#8230; is the bean implementer required to think about if their class is properly serializable? Will an Entity EJB be passivated before a container &quot;serializes&quot; it&#8230; or will an Entity EJB <em>NEVER</em> be serialized by the container&#8230;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Roka-Aardal</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-17</link>
		<dc:creator>Thomas Roka-Aardal</dc:creator>
		<pubDate>Wed, 26 Mar 2003 12:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-17</guid>
		<description>&lt;p&gt;I meant to say &#34;how do you send a bean &lt;em&gt;interface&lt;/em&gt; if it isn't serializable&#34;...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I meant to say &quot;how do you send a bean <em>interface</em> if it isn&#8217;t serializable&quot;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Roka-Aardal</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-16</link>
		<dc:creator>Thomas Roka-Aardal</dc:creator>
		<pubDate>Wed, 26 Mar 2003 12:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-16</guid>
		<description>&lt;p&gt;Isn't this due to the fact that also stateless session beans are remote by spec? I mean, how do you send a bean (rmi) if it isn't serializable? You wouldn't be able to guarantee the marshalling/unmarshalling of your objects.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t this due to the fact that also stateless session beans are remote by spec? I mean, how do you send a bean (rmi) if it isn&#8217;t serializable? You wouldn&#8217;t be able to guarantee the marshalling/unmarshalling of your objects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bjd</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-15</link>
		<dc:creator>bjd</dc:creator>
		<pubDate>Wed, 26 Mar 2003 09:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-15</guid>
		<description>&lt;p&gt;It's my understanding that it's done this way so that EJBs are clusterable across multiple app servers. 
That way you can have two beans which have a 1-to-many relationship and yet still have the bean clusterable.&lt;/p&gt;

&lt;p&gt;eg:
class fooBean implements EntityBean {
   abstract Collection barBean();
   ...
}&lt;/p&gt;

&lt;p&gt;fooBean contains a Collection of barBean, which is not serializable. The javax.ejb.EnterpriseBean
extends Serializable so that the bean &lt;em&gt;is&lt;/em&gt; serializable and thus clusterable.&lt;/p&gt;

&lt;p&gt;I think.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It&#8217;s my understanding that it&#8217;s done this way so that EJBs are clusterable across multiple app servers.<br />
That way you can have two beans which have a 1-to-many relationship and yet still have the bean clusterable.</p>
<p>eg:<br />
class fooBean implements EntityBean {<br />
   abstract Collection barBean();<br />
   &#8230;<br />
}</p>
<p>fooBean contains a Collection of barBean, which is not serializable. The javax.ejb.EnterpriseBean<br />
extends Serializable so that the bean <em>is</em> serializable and thus clusterable.</p>
<p>I think.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver Burn</title>
		<link>http://madbean.com/2003/mb2003-13/#comment-14</link>
		<dc:creator>Oliver Burn</dc:creator>
		<pubDate>Wed, 26 Mar 2003 04:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://madbean.com/blog/2003-13#comment-14</guid>
		<description>&lt;p&gt;Great post - be interested to see if somebody posts the reason why. Other than SUN were lazy. ;-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Great post - be interested to see if somebody posts the reason why. Other than SUN were lazy. ;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
