<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet href="/static/feed.xsl" type="text/xsl" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:quartz="https://quartz.jzhao.xyz/ns">
  <script xmlns="http://www.w3.org/1999/xhtml" src="/static/scripts/xslt-polyfill-214fd525.js"></script>
  <title>/wiki / ejb</title>
  <subtitle>Recent notes in /wiki / ejb on Animesh Mishra</subtitle>
  <link href="https://animishraa05.github.io/wiki/ejb" />
  <link rel="alternate" type="text/html" href="https://animishraa05.github.io/wiki/ejb" />
  <category term="wiki/ejb" />
  <id>https://animishraa05.github.io/wiki/ejb</id>
  <updated>2026-09-02T00:00:00.000Z</updated>
  <contributor>
    <name>Animesh Mishra</name>
    <email>animesh.mishra818@gmail.com</email>
  </contributor>
  <logo>https://animishraa05.github.io/icon.png</logo>
  <icon>https://animishraa05.github.io/icon.png</icon>
  <generator>Quartz v4.6.0 -- quartz.jzhao.xyz</generator>
  <rights type="html">&amp;amp;copy; 2026 Animesh Mishra</rights>
  
  <entry>
    <title>Ejb — Map of Content</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-moc" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-moc.md" />
    <summary> Map of Content for Ejb — 115 concepts. Start here to navigate ejb.</summary>
    <published>2026-09-02T00:00:00.000Z</published>
    <updated>2026-09-02T00:00:00.000Z</updated>
    <publishedTime>Sep 02, 2026</publishedTime>
    <updatedTime>Sep 02, 2026</updatedTime>
    <category term="meta" label="meta" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;blockquote&gt;
&lt;p dir=&quot;auto&quot;&gt;Map of Content for &lt;strong&gt;Ejb&lt;/strong&gt; — 115 concepts. Start here to navigate ejb.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;core-concepts&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Concepts&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-concepts&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;a href=&quot;../../account-bean-bmp-example&quot; class=&quot;internal alias&quot; data-slug=&quot;account-bean-bmp-example&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Account Bean BMP Example&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../activation&quot; class=&quot;internal alias&quot; data-slug=&quot;activation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Activation&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../application-vs-system-exceptions&quot; class=&quot;internal alias&quot; data-slug=&quot;application-vs-system-exceptions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Application vs System Exceptions&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../atomic-name&quot; class=&quot;internal alias&quot; data-slug=&quot;atomic-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Atomic Name&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../bean-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;bean-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Bean-Managed Persistence&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../bidirectional-vs-unidirectional&quot; class=&quot;internal alias&quot; data-slug=&quot;bidirectional-vs-unidirectional&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Bidirectional vs Unidirectional Relationships&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../business-interface-pattern&quot; class=&quot;internal alias&quot; data-slug=&quot;business-interface-pattern&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Business Interface Pattern&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../cdata-hack&quot; class=&quot;internal alias&quot; data-slug=&quot;cdata-hack&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CDATA Hack for XML&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../client-initiated-transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;client-initiated-transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Client-Initiated Transactions&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../client-think-time&quot; class=&quot;internal alias&quot; data-slug=&quot;client-think-time&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Client Think Time&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../cmp-abstract-accessors&quot; class=&quot;internal alias&quot; data-slug=&quot;cmp-abstract-accessors&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CMP Abstract Accessors and Methods&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../cmp-lifecycle&quot; class=&quot;internal alias&quot; data-slug=&quot;cmp-lifecycle&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CMP Entity Bean Lifecycle&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../cmp-vs-bmp&quot; class=&quot;internal&quot; data-slug=&quot;cmp-vs-bmp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;cmp-vs-bmp&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../cmp-vs-bmp-relationships&quot; class=&quot;internal&quot; data-slug=&quot;cmp-vs-bmp-relationships&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;cmp-vs-bmp-relationships&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../component-architecture-soa&quot; class=&quot;internal alias&quot; data-slug=&quot;component-architecture-soa&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Component Architecture &amp;#x26; SOA&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../compound-name&quot; class=&quot;internal alias&quot; data-slug=&quot;compound-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compound Name&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../container-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;container-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Container-Managed Persistence&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../count-bean-example&quot; class=&quot;internal alias&quot; data-slug=&quot;count-bean-example&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Count Bean Example&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../declarative-vs-programmatic-transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;declarative-vs-programmatic-transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Declarative vs Programmatic Transactions&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../distributed-objects&quot; class=&quot;internal alias&quot; data-slug=&quot;distributed-objects&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Distributed Objects&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dont-rely-on-ejbremove&quot; class=&quot;internal alias&quot; data-slug=&quot;dont-rely-on-ejbremove&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Don&#039;t Rely on ejbRemove()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbactivate&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbactivate&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbActivate()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-client-jar&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-client-jar&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Client JAR&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-context&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Context&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbcreate&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbcreate&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbCreate()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-deployment-descriptor&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-deployment-descriptor&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Deployment Descriptor&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-development-lifecycle&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-development-lifecycle&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Development Lifecycle&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbhome&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbhome&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbHome()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-jar-file&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-jar-file&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB-JAR File&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-lifecycle-stateful&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-lifecycle-stateful&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Lifecycle — Stateful&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-lifecycle-stateless&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-lifecycle-stateless&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Lifecycle — Stateless&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbload&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbload&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbLoad()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-naming-service&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-naming-service&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Naming Service&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-object&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-object&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Object&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbpassivate&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbpassivate&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbPassivate()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbpostcreate&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbpostcreate&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbPostCreate()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-ql&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-ql&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Query Language (EJB-QL)&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbremove&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbremove&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbRemove()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-roles&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-roles&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Roles&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejbstore&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbstore&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbStore()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../ejb-verification-generation&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-verification-generation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Verification &amp;#x26; Generation&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../entity-bean-identity&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean-identity&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean Identity&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../entity-bean-instance-vs-data&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean-instance-vs-data&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean Instance vs Data&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../entity-bean-transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean-transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean Transaction Rules&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../entity-context&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Context&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../explicit-vs-implicit-middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;explicit-vs-implicit-middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Explicit vs Implicit Middleware&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../finder-methods&quot; class=&quot;internal alias&quot; data-slug=&quot;finder-methods&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Finder Methods&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../flat-vs-nested-transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;flat-vs-nested-transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Flat vs Nested Transactions&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../getprimarykey&quot; class=&quot;internal alias&quot; data-slug=&quot;getprimarykey&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;getPrimaryKey()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../instance-pooling&quot; class=&quot;internal alias&quot; data-slug=&quot;instance-pooling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Instance Pooling&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../j2ee-compliance&quot; class=&quot;internal alias&quot; data-slug=&quot;j2ee-compliance&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;J2EE Compliance&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../j2ee-specification&quot; class=&quot;internal alias&quot; data-slug=&quot;j2ee-specification&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;J2EE Specification&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../j2ee-tech-stack-compared&quot; class=&quot;internal&quot; data-slug=&quot;j2ee-tech-stack-compared&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;j2ee-tech-stack-compared&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jaas&quot; class=&quot;internal alias&quot; data-slug=&quot;jaas&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JAAS&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../java-idl&quot; class=&quot;internal alias&quot; data-slug=&quot;java-idl&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java IDL&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../javamail&quot; class=&quot;internal alias&quot; data-slug=&quot;javamail&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JavaMail&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jaxp&quot; class=&quot;internal alias&quot; data-slug=&quot;jaxp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JAXP&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jax-rpc&quot; class=&quot;internal alias&quot; data-slug=&quot;jax-rpc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JAX-RPC&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jca&quot; class=&quot;internal alias&quot; data-slug=&quot;jca&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;J2EE Connector Architecture&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jms&quot; class=&quot;internal alias&quot; data-slug=&quot;jms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Message Service (JMS)&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jms-programming-model&quot; class=&quot;internal alias&quot; data-slug=&quot;jms-programming-model&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JMS Programming Model&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jndi-architecture&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-architecture&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Architecture&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jndi-binding&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-binding&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Binding&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jndi-context&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Context&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jndi-naming-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-naming-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Naming Concepts&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jndi-spi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-spi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Service Provider Interface&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jsp&quot; class=&quot;internal alias&quot; data-slug=&quot;jsp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JSP&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jta-jts&quot; class=&quot;internal alias&quot; data-slug=&quot;jta-jts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JTA and JTS&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../local-home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;local-home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Local Home Interface&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../location-transparency&quot; class=&quot;internal alias&quot; data-slug=&quot;location-transparency&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Location Transparency&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../many-to-many-relationship&quot; class=&quot;internal alias&quot; data-slug=&quot;many-to-many-relationship&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Many-to-Many Relationship in EJB&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../message-driven-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;message-driven-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Message-Driven Bean (MDB)&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../message-oriented-middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;message-oriented-middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Message-Oriented Middleware (MOM)&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../normalized-vs-denormalized-schema&quot; class=&quot;internal alias&quot; data-slug=&quot;normalized-vs-denormalized-schema&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Normalized vs Denormalized Database Schema&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../object-relational-mapping&quot; class=&quot;internal alias&quot; data-slug=&quot;object-relational-mapping&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Object-Relational Mapping&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../object-serialization&quot; class=&quot;internal alias&quot; data-slug=&quot;object-serialization&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Object Serialization&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../one-to-many-relationship&quot; class=&quot;internal alias&quot; data-slug=&quot;one-to-many-relationship&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;One-to-Many Relationship in EJB&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../one-to-one-relationship&quot; class=&quot;internal alias&quot; data-slug=&quot;one-to-one-relationship&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;One-to-One Relationship in EJB&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../pass-by-reference-in-rmi&quot; class=&quot;internal alias&quot; data-slug=&quot;pass-by-reference-in-rmi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Pass-by-Reference in RMI&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../pass-by-value-in-rmi&quot; class=&quot;internal alias&quot; data-slug=&quot;pass-by-value-in-rmi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Pass-by-Value in RMI&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../passivation&quot; class=&quot;internal alias&quot; data-slug=&quot;passivation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Passivation&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../persistence-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;persistence-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Persistence Concepts&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../pluggable-message-providers&quot; class=&quot;internal alias&quot; data-slug=&quot;pluggable-message-providers&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Pluggable Message Providers&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../point-to-point-vs-pub-sub&quot; class=&quot;internal alias&quot; data-slug=&quot;point-to-point-vs-pub-sub&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Subscribe Messaging&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../poison-message&quot; class=&quot;internal alias&quot; data-slug=&quot;poison-message&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Poison Message&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../primary-key-class&quot; class=&quot;internal alias&quot; data-slug=&quot;primary-key-class&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Primary Key Class&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../primary-key&quot; class=&quot;internal alias&quot; data-slug=&quot;primary-key&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Primary Key&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../queue-partitioning&quot; class=&quot;internal alias&quot; data-slug=&quot;queue-partitioning&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Queue Partitioning for Business Processing&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../resource-pooling&quot; class=&quot;internal alias&quot; data-slug=&quot;resource-pooling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Resource Pooling&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../rmi-iiop&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-iiop&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI-IIOP&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../rmi-remote-method-invocation&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-remote-method-invocation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI Remote Method Invocation&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../serialization-vs-orm&quot; class=&quot;internal alias&quot; data-slug=&quot;serialization-vs-orm&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Serialization vs ORM&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../servlets&quot; class=&quot;internal alias&quot; data-slug=&quot;servlets&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Servlets&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../session-bean-lifetime&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean-lifetime&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean Lifetime&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../session-bean-relationships&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean-relationships&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean Relationships&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../session-bean-subtypes&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean-subtypes&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean Subtypes&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../session-context&quot; class=&quot;internal alias&quot; data-slug=&quot;session-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;SessionContext&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../setentitycontext&quot; class=&quot;internal alias&quot; data-slug=&quot;setentitycontext&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;setEntityContext()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../stateful-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateful-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateful Session Bean&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../stateful-vs-stateless-session-beans&quot; class=&quot;internal&quot; data-slug=&quot;stateful-vs-stateless-session-beans&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;stateful-vs-stateless-session-beans&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../stateless-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateless-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateless Session Bean&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../stateless-session-bean-pooling&quot; class=&quot;internal alias&quot; data-slug=&quot;stateless-session-bean-pooling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateless Session Bean Pooling&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../subcontext&quot; class=&quot;internal alias&quot; data-slug=&quot;subcontext&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Subcontext&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../transaction-demarcation&quot; class=&quot;internal alias&quot; data-slug=&quot;transaction-demarcation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Transaction Demarcation in EJB&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Transactions in EJB&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../unsetentitycontext&quot; class=&quot;internal alias&quot; data-slug=&quot;unsetentitycontext&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;unsetEntityContext()&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../why-bean-doesnt-implement-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;why-bean-doesnt-implement-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Why Bean Doesn&#039;t Implement Component Interface&lt;/a&gt; — concept&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;mechanisms--how-things-work&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Mechanisms &amp;#x26; How Things Work&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#mechanisms--how-things-work&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;em&gt;Auto-generated — edit to curate. Pages that explain processes/flows.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;comparisons--tradeoffs&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Comparisons &amp;#x26; Tradeoffs&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#comparisons--tradeoffs&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;em&gt;(No synthesis yet — create via ingest or query —save)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;suggested-reading-order&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Suggested Reading Order&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#suggested-reading-order&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Browse Core Concepts above — start with most-linked page&lt;/li&gt;
&lt;li&gt;Follow Connections sections for dense graph traversal&lt;/li&gt;
&lt;/ol&gt;</content>
  </entry><entry>
    <title>rmi-registry</title>
    <link href="https://animishraa05.github.io/wiki/ejb/rmi-registry" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/rmi-registry.md" />
    <summary>The Problem Auto-created stub for broken link [[rmi-registry]] — needs human content.</summary>
    <published>2026-09-02T00:00:00.000Z</published>
    <updated>2026-09-02T00:00:00.000Z</updated>
    <publishedTime>Sep 02, 2026</publishedTime>
    <updatedTime>Sep 02, 2026</updatedTime>
    <category term="dev" label="dev" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Auto-created stub for broken link &lt;code class=&quot;notranslate&quot;&gt;[[rmi-registry]]&lt;/code&gt; — needs human content.&lt;/p&gt;
&lt;h2 id=&quot;formal-definition&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Formal Definition&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#formal-definition&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Per Wikipedia: “To be written.”&lt;/p&gt;
&lt;h2 id=&quot;explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Stub — fill with plain language explanation.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;To be written.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;dot&quot; data-theme=&quot;github-light github-dark&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;dot&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;digraph rmi-registry {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  rankdir=LR&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  node [shape=box style=filled fillcolor=&quot;#f0f4ff&quot; fontname=&quot;Helvetica&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  A [label=&quot;Stub: rmi-registry&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  B [label=&quot;To be written&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  A -&gt; B [label=&quot;needs content&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;semantic-network&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Semantic Network&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#semantic-network&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;dot&quot; data-theme=&quot;github-light github-dark&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;dot&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;graph semantic_rmi-registry {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  layout=neato&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  node [shape=ellipse fontname=&quot;Helvetica&quot; fontsize=11 style=filled]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  THIS [label=&quot;rmi registry&quot; fillcolor=&quot;#ffd700&quot; fontsize=13 style=&quot;filled,bold&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  REL1 [label=&quot;Related&quot; fillcolor=&quot;#f0f0f0&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;  THIS -- REL1 [label=&quot;related&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;To be written.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;real-world-example&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Real-World Example&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#real-world-example&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot; data-theme=&quot;github-light github-dark&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;python&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;TODO&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;: add example&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../&quot; class=&quot;internal alias&quot; data-slug=&quot;index&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Index&lt;/a&gt; — auto stub, needs proper links&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;To be written.&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>account-bean-bmp-example</title>
    <link href="https://animishraa05.github.io/wiki/ejb/account-bean-bmp-example" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/account-bean-bmp-example.md" />
    <summary>The Problem Students need a concrete BMP (Bean-Managed Persistence) example that shows all pieces: remote interface, home interface, primary key class, bean class with JDBC code, deployment descriptor, and client code—without the fluff.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="bmp" label="bmp" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Students need a concrete BMP (Bean-Managed Persistence) example that shows all pieces: remote interface, home interface, primary key class, bean class with JDBC code, deployment descriptor, and client code—without the fluff.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The Account Bean is a BMP entity bean representing a bank account. It demonstrates: &lt;code class=&quot;notranslate&quot;&gt;Account&lt;/code&gt; remote interface, &lt;code class=&quot;notranslate&quot;&gt;AccountHome&lt;/code&gt; home interface with finder methods, &lt;code class=&quot;notranslate&quot;&gt;AccountPK&lt;/code&gt; primary key class, &lt;code class=&quot;notranslate&quot;&gt;AccountBean&lt;/code&gt; with JDBC code for CRUD, &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt; with &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;persistence-type&gt;Bean&amp;#x3C;/persistence-type&gt;&lt;/code&gt;, and client code using JNDI lookups.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;1-remote-interface-accountjava&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;1. Remote Interface (&lt;code class=&quot;notranslate&quot;&gt;Account.java&lt;/code&gt;)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#1-remote-interface-accountjava&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; javax.ejb.EJBObject;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; java.rmi.RemoteException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt; &lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Account&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; EJBObject&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; deposit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;double&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt; amt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; RemoteException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; withdraw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;double&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt; amt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; RemoteException, AccountException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; double&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; getBalance&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; RemoteException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;2-home-interface-accounthomejava&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;2. Home Interface (&lt;code class=&quot;notranslate&quot;&gt;AccountHome.java&lt;/code&gt;)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#2-home-interface-accounthomejava&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AccountHome&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; EJBHome&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; Account &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(String &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;accountID&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, String &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;ownerName&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; RemoteException, CreateException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; Account &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;findByPrimaryKey&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(AccountPK &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; RemoteException, FinderException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; double&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; getTotalBankValue&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; RemoteException, AccountException; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// Home method&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;3-primary-key-class-accountpkjava&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;3. Primary Key Class (&lt;code class=&quot;notranslate&quot;&gt;AccountPK.java&lt;/code&gt;)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#3-primary-key-class-accountpkjava&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AccountPK&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; implements&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Serializable&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; String accountID;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AccountPK&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() {}&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AccountPK&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(String &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) { &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.accountID &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; id; }&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;4-deployment-descriptor-ejb-jarxml&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;4. Deployment Descriptor (&lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#4-deployment-descriptor-ejb-jarxml&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p dir=&quot;auto&quot;&gt;Key elements: &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;persistence-type&gt;Bean&amp;#x3C;/persistence-type&gt;&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;prim-key-class&gt;examples.bmp.AccountPK&amp;#x3C;/prim-key-class&gt;&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;resource-ref&gt;&lt;/code&gt; for JDBC.&lt;/p&gt;
&lt;h3 id=&quot;5-client-code&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;5. Client Code&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#5-client-code&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p dir=&quot;auto&quot;&gt;Looks up Home via JNDI, calls &lt;code class=&quot;notranslate&quot;&gt;home.create()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;account.deposit(100)&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;home.findByPrimaryKey(pk)&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;399pt&quot; height=&quot;472pt&quot; viewBox=&quot;0.00 0.00 399.00 472.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 468.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-468.2 395.34,-468.2 395.34,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;207.95,-464.2 153.95,-464.2 153.95,-428.2 207.95,-428.2 207.95,-464.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;180.95&quot; y=&quot;-442&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client&lt;/text&gt;
&lt;/g&gt;
&lt;!-- AccountHome (Home Object) --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;AccountHome (Home Object)&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;180.95,-375.4 0,-357.4 180.95,-339.4 361.9,-357.4 180.95,-375.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;180.95&quot; y=&quot;-353.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;AccountHome (Home Object)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;AccountHome (Home Object) --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;AccountHome (Home Object)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M180.95,-428.05C180.95,-416.36 180.95,-400.59 180.95,-387.02&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;184.45,-387.32 180.95,-377.32 177.45,-387.32 184.45,-387.32&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;217.31&quot; y=&quot;-397.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI lookup&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Account (EJB Object) --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Account (EJB Object)&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;251.16,-286.6 110.75,-286.6 110.75,-250.6 251.16,-250.6 251.16,-286.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;180.95&quot; y=&quot;-264.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Account (EJB Object)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- AccountHome (Home Object)&amp;#45;&amp;gt;Account (EJB Object) --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;AccountHome (Home Object)-&gt;Account (EJB Object)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M180.95,-339.25C180.95,-327.56 180.95,-311.79 180.95,-298.22&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;184.45,-298.52 180.95,-288.52 177.45,-298.52 184.45,-298.52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;202.32&quot; y=&quot;-308.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;create()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- AccountBean --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;AccountBean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M215.05,-197.8C215.05,-197.8 146.86,-197.8 146.86,-197.8 140.86,-197.8 134.86,-191.8 134.86,-185.8 134.86,-185.8 134.86,-173.8 134.86,-173.8 134.86,-167.8 140.86,-161.8 146.86,-161.8 146.86,-161.8 215.05,-161.8 215.05,-161.8 221.05,-161.8 227.05,-167.8 227.05,-173.8 227.05,-173.8 227.05,-185.8 227.05,-185.8 227.05,-191.8 221.05,-197.8 215.05,-197.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;180.95&quot; y=&quot;-175.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;AccountBean&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Account (EJB Object)&amp;#45;&amp;gt;AccountBean --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Account (EJB Object)-&gt;AccountBean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M180.95,-250.45C180.95,-238.76 180.95,-222.99 180.95,-209.42&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;184.45,-209.72 180.95,-199.72 177.45,-209.72 184.45,-209.72&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;206.99&quot; y=&quot;-220&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;delegates&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Database --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Database&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M214.6,-105.73C214.6,-107.53 199.52,-109 180.95,-109 162.38,-109 147.3,-107.53 147.3,-105.73 147.3,-105.73 147.3,-76.27 147.3,-76.27 147.3,-74.47 162.38,-73 180.95,-73 199.52,-73 214.6,-74.47 214.6,-76.27 214.6,-76.27 214.6,-105.73 214.6,-105.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M214.6,-105.73C214.6,-103.92 199.52,-102.45 180.95,-102.45 162.38,-102.45 147.3,-103.92 147.3,-105.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;180.95&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Database&lt;/text&gt;
&lt;/g&gt;
&lt;!-- AccountBean&amp;#45;&amp;gt;Database --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;AccountBean-&gt;Database&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M180.95,-161.65C180.95,-149.96 180.95,-134.19 180.95,-120.62&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;184.45,-120.92 180.95,-110.92 177.45,-120.92 184.45,-120.92&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;286.15&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JDBC (INSERT/UPDATE/SELECT)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- accounts table --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;accounts table&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;222.8,-36 133.11,-36 133.11,0 228.8,0 228.8,-30 222.8,-36&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;222.8,-36 222.8,-30&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;228.8,-30 222.8,-30&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;180.95&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;accounts table&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Database&amp;#45;&amp;gt;accounts table --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Database-&gt;accounts table&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M180.95,-72.81C180.95,-65.23 180.95,-56.1 180.95,-47.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;184.45,-47.54 180.95,-37.54 177.45,-47.54 184.45,-47.54&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;BMP&lt;/strong&gt;: Bean writes all JDBC code (ejbCreate → INSERT, ejbLoad → SELECT, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AccountPK&lt;/strong&gt;: Wrapper for primary key (String accountID)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Home methods&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;getTotalBankValue()&lt;/code&gt; runs from pool, not specific instance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource reference&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;resource-ref&gt;&lt;/code&gt; configures JDBC DataSource in JNDI&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CMT&lt;/strong&gt;: Deployment descriptor sets &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;transaction-type&gt;Container&amp;#x3C;/transaction-type&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../bean-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;bean-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Bean-Managed Persistence&lt;/a&gt; — this is a BMP example&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../primary-key-class&quot; class=&quot;internal alias&quot; data-slug=&quot;primary-key-class&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Primary Key Class&lt;/a&gt; — AccountPK is the PK class&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt; — AccountHome with finder methods&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt; — Account interface&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt; — BMP uses JDBC for all DB operations&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-deployment-descriptor&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-deployment-descriptor&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Deployment Descriptor&lt;/a&gt; — XML config shown&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../finder-methods&quot; class=&quot;internal alias&quot; data-slug=&quot;finder-methods&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Finder Methods&lt;/a&gt; — &lt;code class=&quot;notranslate&quot;&gt;findByPrimaryKey()&lt;/code&gt; is a finder&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../account-exception&quot; class=&quot;internal alias&quot; data-slug=&quot;account-exception&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;AccountException&lt;/a&gt; — custom application exception&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;SQL exceptions&lt;/strong&gt;: Must handle &lt;code class=&quot;notranslate&quot;&gt;SQLException&lt;/code&gt; in BMP JDBC code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Withdraw validation&lt;/strong&gt;: Check balance before withdrawing (throw &lt;code class=&quot;notranslate&quot;&gt;AccountException&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Home methods&lt;/strong&gt;: Run on pooled bean, not associated with specific EJB object&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource reference&lt;/strong&gt;: Must configure &lt;code class=&quot;notranslate&quot;&gt;jdbc/bmp-account&lt;/code&gt; in container-specific descriptor&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;12-mark question&lt;/strong&gt;: Focus on interfaces, PK class, XML—not full JDBC code&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>application-vs-system-exceptions</title>
    <link href="https://animishraa05.github.io/wiki/ejb/application-vs-system-exceptions" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/application-vs-system-exceptions.md" />
    <summary>The Problem When something goes wrong in your EJB, how should the container handle it? Should it tell the client? Should it rollback the transaction? Should it alert the administrator? Different errors need different treatments.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When something goes wrong in your EJB, how should the container handle it? Should it tell the client? Should it rollback the transaction? Should it alert the administrator? Different errors need different treatments.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;EJB defines two exception types with different handling strategies:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Application Exceptions&lt;/strong&gt;: Routine business problems (bad input, insufficient funds). Always thrown back to the client—the client needs to know and handle these.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;System Exceptions&lt;/strong&gt;: Critical failures (database down, &lt;code class=&quot;notranslate&quot;&gt;NullPointerException&lt;/code&gt;). Container intercepts these, may alert admin, and usually discards the bean (it’s in an undefined state).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Aspect&lt;/th&gt;&lt;th&gt;Application Exception&lt;/th&gt;&lt;th&gt;System Exception&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code class=&quot;notranslate&quot;&gt;CreateException&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;InsufficientFundsException&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code class=&quot;notranslate&quot;&gt;NullPointerException&lt;/code&gt;, DB connection failure&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Thrown to client?&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Always&lt;/td&gt;&lt;td&gt;May be wrapped as &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Transaction&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Client decides rollback&lt;/td&gt;&lt;td&gt;Container may auto-rollback&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Bean state&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Bean remains usable&lt;/td&gt;&lt;td&gt;Bean is discarded (undefined state)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Defined in&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code class=&quot;notranslate&quot;&gt;javax.ejb&lt;/code&gt; package or custom&lt;/td&gt;&lt;td&gt;&lt;code class=&quot;notranslate&quot;&gt;java.lang.RuntimeException&lt;/code&gt; or &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: ExceptionHandling Pages: 1 --&gt;
&lt;svg width=&quot;346pt&quot; height=&quot;333pt&quot; viewBox=&quot;0.00 0.00 346.00 333.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 328.8)&quot;&gt;
&lt;title&gt;ExceptionHandling&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-328.8 342.41,-328.8 342.41,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;214.92,-324.8 109.12,-324.8 109.12,-288.8 214.92,-288.8 214.92,-324.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;162.02&quot; y=&quot;-302.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Enterprise Bean&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJBObj --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJBObj&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;202.1,-219.2 121.94,-219.2 121.94,-177.6 202.1,-177.6 202.1,-219.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;162.02&quot; y=&quot;-202.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;162.02&quot; y=&quot;-185.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Proxy)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;EJBObj --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;EJBObj&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M108.7,-290.21C100.16,-285.35 92.43,-279.03 87.19,-270.8 79.18,-258.2 79.37,-249.92 87.19,-237.2 92.97,-227.82 101.87,-220.68 111.55,-215.27&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;113.01,-218.46 120.45,-210.92 109.93,-212.17 113.01,-218.46&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;152.11&quot; y=&quot;-258.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;App Exception&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;152.11&quot; y=&quot;-241.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(e.g., CreateException)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;EJBObj --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;EJBObj&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;red&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M200.62,-288.42C207.2,-283.67 213.16,-277.84 217.02,-270.8 224.21,-257.71 223.98,-250.42 217.02,-237.2 215.16,-233.66 212.8,-230.38 210.1,-227.37&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;red&quot; stroke=&quot;red&quot; points=&quot;212.57,-224.88 202.89,-220.59 207.78,-229.99 212.57,-224.88&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;273.07&quot; y=&quot;-258.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;System Exception&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;273.07&quot; y=&quot;-241.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(e.g., NPE)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Container&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;98.04,-124.8 0,-124.8 0,-88.8 98.04,-88.8 98.04,-124.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;49.02&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJBObj&amp;#45;&amp;gt;Container --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJBObj-&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M136.66,-177.29C119.82,-163.94 97.6,-146.32 79.75,-132.17&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;82.06,-129.53 72.05,-126.06 77.72,-135.02 82.06,-129.53&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;143.77&quot; y=&quot;-147&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Intercepted&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;189.02,-36 135.02,-36 135.02,0 189.02,0 189.02,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;162.02&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJBObj&amp;#45;&amp;gt;Client --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJBObj-&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M198.45,-177.23C216.99,-164.78 237.73,-146.95 248.02,-124.8 262.28,-94.11 245.5,-76.26 220.02,-54 213.69,-48.47 206.37,-43.29 199.11,-38.71&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;201.02,-35.78 190.64,-33.63 197.41,-41.78 201.02,-35.78&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;295.83&quot; y=&quot;-111&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Passed through&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;295.83&quot; y=&quot;-94.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;as-is&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container&amp;#45;&amp;gt;Container --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container-&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M98.42,-114.83C108.67,-113.99 116.04,-111.31 116.04,-106.8 116.04,-104.19 113.58,-102.2 109.52,-100.82&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;110.37,-97.41 99.9,-99.04 109.1,-104.3 110.37,-97.41&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;177.66&quot; y=&quot;-111&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Alert admin,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;177.66&quot; y=&quot;-94.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;rollback, discard bean&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container&amp;#45;&amp;gt;Client --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container-&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M71.62,-88.44C88.48,-75.49 111.73,-57.63 130.43,-43.27&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;132.47,-46.12 138.27,-37.25 128.2,-40.56 132.47,-46.12&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;165.8&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;RemoteException&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;EJB Object intercepts exceptions&lt;/strong&gt;: It decides what to do before reaching client&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application exceptions are part of business logic&lt;/strong&gt;: They carry valuable data for the client&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;System exceptions leave bean in undefined state&lt;/strong&gt;: Container stops using that bean instance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two rules of thumb&lt;/strong&gt;:
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Application exceptions → always thrown to client&lt;/li&gt;
&lt;li&gt;System exceptions → container can do anything (alert, discard, throw)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../ejb-object&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-object&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Object&lt;/a&gt; (intercepts exceptions)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Transactions&lt;/a&gt; (exceptions affect transaction outcome)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; (handles system exceptions)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Regular Java (all exceptions handled the same way)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Unchecked exceptions are system exceptions&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;RuntimeException&lt;/code&gt; subclasses are treated as system exceptions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Don’t rely on &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; for cleanup&lt;/strong&gt;: If a system exception occurs, &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; may never be called&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transparent failover&lt;/strong&gt;: Some containers redirect to another bean for stateless beans after system exceptions&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>atomic-name</title>
    <link href="https://animishraa05.github.io/wiki/ejb/atomic-name" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/atomic-name.md" />
    <summary>The Problem In a hierarchical naming system like JNDI, we need a way to refer to individual name components.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;In a hierarchical naming system like JNDI, we need a way to refer to individual name components. How do we represent the smallest, indivisible unit of a name that cannot be further subdivided?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;An atomic name is a simple, basic, indivisible name in JNDI. Examples include &lt;code class=&quot;notranslate&quot;&gt;etc&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;fstab&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;usr&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;bin&lt;/code&gt; — each is a single component that cannot be split further. They are the building blocks of compound names.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Atomic names are the leaf components in a compound name&lt;/li&gt;
&lt;li&gt;In &lt;code class=&quot;notranslate&quot;&gt;/etc/fstab&lt;/code&gt;, the atomic names are &lt;code class=&quot;notranslate&quot;&gt;etc&lt;/code&gt; and &lt;code class=&quot;notranslate&quot;&gt;fstab&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;In JNDI, each binding in a context has a distinct atomic name&lt;/li&gt;
&lt;li&gt;Atomic names are combined with a syntax (like &lt;code class=&quot;notranslate&quot;&gt;/&lt;/code&gt;) to form compound names&lt;/li&gt;
&lt;li&gt;They serve as keys in the binding table of a context&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;307pt&quot; height=&quot;110pt&quot; viewBox=&quot;0.00 0.00 307.00 110.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 105.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-105.6 302.56,-105.6 302.56,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Compound Name: /usr/bin --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Compound Name: /usr/bin&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;159.32,-68.8 0,-68.8 0,-32.8 165.32,-32.8 165.32,-62.8 159.32,-68.8&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;159.32,-68.8 159.32,-62.8&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;165.32,-62.8 159.32,-62.8&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;82.66&quot; y=&quot;-46.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Compound Name: /usr/bin&lt;/text&gt;
&lt;/g&gt;
&lt;!-- usr --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;usr&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;298.56,-101.6 201.32,-101.6 201.32,-60 298.56,-60 298.56,-101.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;249.94&quot; y=&quot;-85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;usr&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;249.94&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Compound Name: /usr/bin&amp;#45;&amp;gt;usr --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Compound Name: /usr/bin-&gt;usr&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M165.82,-65.71C173.98,-67.19 182.15,-68.68 190.01,-70.1&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;189.31,-73.53 199.78,-71.88 190.56,-66.65 189.31,-73.53&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- bin --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;bin&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;298.56,-41.6 201.32,-41.6 201.32,0 298.56,0 298.56,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;249.94&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;bin&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;249.94&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Compound Name: /usr/bin&amp;#45;&amp;gt;bin --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Compound Name: /usr/bin-&gt;bin&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M165.82,-35.89C173.98,-34.41 182.15,-32.92 190.01,-31.5&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;190.56,-34.95 199.78,-29.72 189.31,-28.07 190.56,-34.95&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Indivisible&lt;/strong&gt;: Cannot be split into smaller naming components&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Syntax-independent&lt;/strong&gt;: The atomic name itself doesn’t include separators&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unique within context&lt;/strong&gt;: Each atomic name in a context maps to one binding&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Case-sensitive&lt;/strong&gt;: Typically, atomic names are case-sensitive&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Building block&lt;/strong&gt;: Combined to form compound names&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jndi-naming-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-naming-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Naming Concepts&lt;/a&gt; — atomic names are part of JNDI naming&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../compound-name&quot; class=&quot;internal alias&quot; data-slug=&quot;compound-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compound Name&lt;/a&gt; — atomic names combine to form compound names&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi-context&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Context&lt;/a&gt; — contexts contain bindings with atomic names&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi-binding&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-binding&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Binding&lt;/a&gt; — each binding has an atomic name as its key&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Special characters&lt;/strong&gt;: Some characters may have special meaning in compound name syntax&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Length limits&lt;/strong&gt;: Providers may impose limits on atomic name length&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reserved words&lt;/strong&gt;: Some names may be reserved by the provider&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>business-interface-pattern</title>
    <link href="https://animishraa05.github.io/wiki/ejb/business-interface-pattern" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/business-interface-pattern.md" />
    <summary>The Problem EJB component interfaces (Remote/Local) extend EJB-specific interfaces (EJBObject, EJBLocalObject) which have methods meant for clients, not beans.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;EJB component interfaces (Remote/Local) extend EJB-specific interfaces (&lt;code class=&quot;notranslate&quot;&gt;EJBObject&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;EJBLocalObject&lt;/code&gt;) which have methods meant for clients, not beans. If beans don’t implement the component interface (to avoid pollution), how do we get compile-time checking that the bean has all required business methods?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Define a “pure” business interface containing only your business method signatures—no EJB dependencies. Have both the Remote/Local interface AND the bean class implement this business interface. This gives compile-time checking without polluting the bean with EJB client methods.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// 1. Pure business interface (no EJB stuff)&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HelloBusinessMethods&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    String &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;hello&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; RemoteException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt; &lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// 2. Remote interface extends BOTH EJBObject and business interface&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HelloRemote&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; javax.ejb.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;EJBObject&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;HelloBusinessMethods&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt; &lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// 3. Local interface also extends business interface&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HelloLocal&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; javax.ejb.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;EJBLocalObject&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;HelloBusinessMethods&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt; &lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// 4. Bean implements business interface (+ SessionBean)&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HelloBean&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; implements&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; SessionBean&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;HelloBusinessMethods&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; String &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;hello&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() { &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;Hello, World!&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: BusinessInterface Pages: 1 --&gt;
&lt;svg width=&quot;488pt&quot; height=&quot;161pt&quot; viewBox=&quot;0.00 0.00 488.00 161.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 156.8)&quot;&gt;
&lt;title&gt;BusinessInterface&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-156.8 484.15,-156.8 484.15,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- BI --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;BI&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;282.72,-152.8 163.7,-152.8 163.7,-94.4 282.72,-94.4 282.72,-152.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;223.21&quot; y=&quot;-136.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Business Interface&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;223.21&quot; y=&quot;-119.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(pure, no EJB)&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;223.21&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;+ hello()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RI --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RI&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;126.42,-58.4 0,-58.4 0,0 126.42,0 126.42,-58.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;63.21&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Remote Interface&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;63.21&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;extends EJBObject,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;63.21&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Business Interface&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BI&amp;#45;&amp;gt;RI --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;BI-&gt;RI&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M173.9,-94.12C157.63,-84.73 139.36,-74.18 122.42,-64.4&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;124.35,-61.47 113.94,-59.5 120.85,-67.53 124.35,-61.47&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- LI --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LI&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;302.36,-58.4 144.07,-58.4 144.07,0 302.36,0 302.36,-58.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;223.21&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Local Interface&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;223.21&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;extends EJBLocalObject,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;223.21&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Business Interface&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BI&amp;#45;&amp;gt;LI --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;BI-&gt;LI&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M223.21,-94.12C223.21,-86.57 223.21,-78.27 223.21,-70.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;226.71,-70.26 223.21,-60.26 219.71,-70.26 226.71,-70.26&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;480.15,-58.4 320.27,-58.4 320.27,0 480.15,0 480.15,-58.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;400.21&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HelloBean&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;400.21&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;implements SessionBean,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;400.21&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Business Interface&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BI&amp;#45;&amp;gt;Bean --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;BI-&gt;Bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M277.76,-94.12C296.01,-84.59 316.54,-73.88 335.49,-63.99&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;336.95,-67.17 344.19,-59.44 333.71,-60.97 336.95,-67.17&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Compile-time safety&lt;/strong&gt;: If bean misses a business method, compilation fails&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No pollution&lt;/strong&gt;: Bean doesn’t implement &lt;code class=&quot;notranslate&quot;&gt;EJBObject&lt;/code&gt; methods&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared contract&lt;/strong&gt;: Both bean and EJB object share the same business method signatures&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One downside&lt;/strong&gt;: Local interface inherits &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt; from business interface (if business interface declares it)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../why-bean-doesnt-implement-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;why-bean-doesnt-implement-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Why Bean Doesn&#039;t Implement Component Interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt;, &lt;a href=&quot;../../local-home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;local-home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Local Home Interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;, &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Direct implementation (bean implements remote interface directly)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt; leakage&lt;/strong&gt;: Business interface meant for both remote and local still declares &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;—local clients don’t need it&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EJB 3.x+ solves this&lt;/strong&gt;: Uses &lt;code class=&quot;notranslate&quot;&gt;@Local&lt;/code&gt; and &lt;code class=&quot;notranslate&quot;&gt;@Remote&lt;/code&gt; annotations—no need for this pattern&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Not mandatory&lt;/strong&gt;: Most developers just let the container verify at deployment time (not compile time)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>client-think-time</title>
    <link href="https://animishraa05.github.io/wiki/ejb/client-think-time" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/client-think-time.md" />
    <summary>The Problem When analyzing server capacity, we might assume each client needs a dedicated bean instance.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="performance" label="performance" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When analyzing server capacity, we might assume each client needs a dedicated bean instance. But users don’t click buttons continuously—they read pages, think, and then act. How can we leverage this idle time to serve more clients with fewer resources?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Client think time is the period when a user is viewing a page or thinking between actions. During this time, the server-side bean instance can be reassigned to serve other clients, dramatically improving resource utilization.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;User clicks button&lt;/strong&gt;: Server assigns bean, executes method, returns response&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;User reads page&lt;/strong&gt;: Server returns bean to pool (5-10 minutes of idle time)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pool reuse&lt;/strong&gt;: Same bean serves other clients during this idle period&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Result&lt;/strong&gt;: 50-100 beans can serve 10,000 clients&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;This is the key insight that makes instance pooling viable for human-facing applications.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;666pt&quot; height=&quot;189pt&quot; viewBox=&quot;0.00 0.00 666.00 189.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 185.07)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-185.07 661.62,-185.07 661.62,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client A --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client A&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;63.83,-71.07 0,-71.07 0,-35.07 63.83,-35.07 63.83,-71.07&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.92&quot; y=&quot;-48.87&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client A&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean 1 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean 1&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;473.02,-71.07 417.76,-71.07 417.76,-35.07 473.02,-35.07 473.02,-71.07&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;445.39&quot; y=&quot;-48.87&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bean 1&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client A&amp;#45;&amp;gt;Bean 1 --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client A-&gt;Bean 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M64.24,-68.26C69.98,-70.54 76,-72.61 81.83,-74.07 186.13,-100.27 215.7,-87.96 323.19,-91.07 357.2,-92.06 367.82,-102.83 399.76,-91.07 407.07,-88.38 414,-83.9 420.13,-78.94&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;422.22,-81.76 427.35,-72.49 417.56,-76.54 422.22,-81.76&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;245.28&quot; y=&quot;-95.53&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;request&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Think Time --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Think Time&lt;/title&gt;
&lt;polygon fill=&quot;lightpink&quot; stroke=&quot;black&quot; points=&quot;299.19,-73.87 185.38,-73.87 185.38,-32.27 305.19,-32.27 305.19,-67.87 299.19,-73.87&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;299.19,-73.87 299.19,-67.87&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;305.19,-67.87 299.19,-67.87&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;245.28&quot; y=&quot;-57.27&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client A reading...&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;245.28&quot; y=&quot;-40.47&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(2 minutes)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client A&amp;#45;&amp;gt;Think Time --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client A-&gt;Think Time&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M64.1,-53.07C92.83,-53.07 136.49,-53.07 173.63,-53.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;173.42,-56.57 183.42,-53.07 173.42,-49.57 173.42,-56.57&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;124.6&quot; y=&quot;-57.27&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;starts reading&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client B --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client B&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;657.62,-71.07 594.57,-71.07 594.57,-35.07 657.62,-35.07 657.62,-71.07&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;626.1&quot; y=&quot;-48.87&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client B&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client C --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client C&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;276.81,-181.07 213.75,-181.07 213.75,-145.07 276.81,-145.07 276.81,-181.07&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;245.28&quot; y=&quot;-158.87&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client C&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean 1&amp;#45;&amp;gt;Client A --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean 1-&gt;Client A&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M417.33,-41.04C389.76,-29.49 345.45,-12.86 305.19,-6.27 252.64,2.32 238.04,1.63 185.38,-6.27 146.97,-12.04 104.88,-25.53 74.67,-36.56&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;73.67,-33.2 65.52,-39.97 76.12,-39.76 73.67,-33.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;245.28&quot; y=&quot;-10.47&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;response&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean 1&amp;#45;&amp;gt;Client B --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean 1-&gt;Client B&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M473.14,-53.07C502.15,-53.07 548.84,-53.07 582.81,-53.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;582.74,-56.57 592.74,-53.07 582.74,-49.57 582.74,-56.57&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;533.79&quot; y=&quot;-57.27&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;serves Client B&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean 2 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean 2&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;59.55,-181.07 4.28,-181.07 4.28,-145.07 59.55,-145.07 59.55,-181.07&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.92&quot; y=&quot;-158.87&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bean 2&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean 2&amp;#45;&amp;gt;Client C --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean 2-&gt;Client C&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M59.69,-163.07C95.53,-163.07 159.51,-163.07 201.93,-163.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;201.76,-166.57 211.76,-163.07 201.76,-159.57 201.76,-166.57&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;124.6&quot; y=&quot;-167.27&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;serves Client C&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Think Time&amp;#45;&amp;gt;Bean 1 --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Think Time-&gt;Bean 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M305.45,-53.07C337.97,-53.07 377.38,-53.07 405.91,-53.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;405.91,-56.57 415.91,-53.07 405.91,-49.57 405.91,-56.57&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;361.47&quot; y=&quot;-74.07&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;bean returned&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;361.47&quot; y=&quot;-57.27&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;to pool&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Human behavior&lt;/strong&gt;: Users spend most time reading, not clicking&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource multiplier&lt;/strong&gt;: 50 beans can serve 10,000 clients&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Key to pooling&lt;/strong&gt;: Makes stateless session bean pooling effective&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Not applicable&lt;/strong&gt;: Automated clients (APIs) may not have think time&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exam keyword&lt;/strong&gt;: Mention in instance pooling answers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../instance-pooling&quot; class=&quot;internal alias&quot; data-slug=&quot;instance-pooling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Instance Pooling&lt;/a&gt; — think time enables pooling efficiency&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../stateless-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateless-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateless Session Bean&lt;/a&gt; — primary beneficiary&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../session-bean-lifetime&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean-lifetime&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean Lifetime&lt;/a&gt; — beans returned to pool during think time&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../scalability&quot; class=&quot;internal alias&quot; data-slug=&quot;scalability&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Scalability&lt;/a&gt; — think time improves scalability&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;API clients&lt;/strong&gt;: May not have think time (continuous requests)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeout&lt;/strong&gt;: Session may timeout during long think time&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stateful beans&lt;/strong&gt;: Have dedicated state, can’t leverage think time for pooling&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>component-architecture-soa</title>
    <link href="https://animishraa05.github.io/wiki/ejb/component-architecture-soa" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/component-architecture-soa.md" />
    <summary>The Problem Monolithic applications mixed everything together—UI, business logic, and data access all in one codebase.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Monolithic applications mixed everything together—UI, business logic, and data access all in one codebase. This made code impossible to reuse across different applications and hard to maintain as the application grew.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;“Divide and Conquer” applied to software architecture. Break a large application into small, independent pieces (components/services), where each component handles a specific responsibility. These components can be reused across multiple applications.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Decomposition&lt;/strong&gt;: Identify distinct responsibilities and split them into separate components&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interface Definition&lt;/strong&gt;: Each component exposes a contract (interface) defining what it can do&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Independent Deployment&lt;/strong&gt;: Components can be developed, deployed, and updated independently&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reusability&lt;/strong&gt;: Same component can serve multiple applications&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;In EJB, the component architecture manifests as:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Enterprise Beans = business logic components&lt;/li&gt;
&lt;li&gt;Interfaces (Remote/Local) = contracts&lt;/li&gt;
&lt;li&gt;Container = runtime environment managing components&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: ComponentArchitecture Pages: 1 --&gt;
&lt;svg width=&quot;453pt&quot; height=&quot;188pt&quot; viewBox=&quot;0.00 0.00 453.00 188.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 184)&quot;&gt;
&lt;title&gt;ComponentArchitecture&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-184 448.61,-184 448.61,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- App1 --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;App1&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;156.77,-180 61.06,-180 61.06,-144 156.77,-144 156.77,-180&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;108.91&quot; y=&quot;-157.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Application A&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Comp1 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Comp1&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;133.82,-108 0,-108 0,-72 133.82,-72 133.82,-108&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;66.91&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Payment Component&lt;/text&gt;
&lt;/g&gt;
&lt;!-- App1&amp;#45;&amp;gt;Comp1 --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;App1-&gt;Comp1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M98.53,-143.7C93.85,-135.9 88.22,-126.51 83.01,-117.83&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.1,-116.18 77.95,-109.4 80.1,-119.78 86.1,-116.18&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Comp2 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Comp2&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;291.54,-108 152.28,-108 152.28,-72 291.54,-72 291.54,-108&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;221.91&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Inventory Component&lt;/text&gt;
&lt;/g&gt;
&lt;!-- App1&amp;#45;&amp;gt;Comp2 --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;App1-&gt;Comp2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M137.14,-143.52C151.4,-134.68 168.9,-123.84 184.29,-114.3&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;186.1,-117.3 192.76,-109.06 182.42,-111.35 186.1,-117.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- App2 --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;App2&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;290.38,-180 195.44,-180 195.44,-144 290.38,-144 290.38,-180&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;242.91&quot; y=&quot;-157.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Application B&lt;/text&gt;
&lt;/g&gt;
&lt;!-- App2&amp;#45;&amp;gt;Comp1 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;App2-&gt;Comp1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M198.95,-143.52C175.35,-134.13 146.04,-122.47 121.04,-112.53&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;122.61,-109.38 112.02,-108.94 120.02,-115.89 122.61,-109.38&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Comp3 --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Comp3&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;444.61,-108 309.21,-108 309.21,-72 444.61,-72 444.61,-108&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;376.91&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Shipping Component&lt;/text&gt;
&lt;/g&gt;
&lt;!-- App2&amp;#45;&amp;gt;Comp3 --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;App2-&gt;Comp3&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M276.38,-143.52C293.78,-134.43 315.24,-123.22 333.86,-113.49&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;335.29,-116.69 342.53,-108.96 332.04,-110.49 335.29,-116.69&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- App3 --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;App3&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;413.38,-180 318.44,-180 318.44,-144 413.38,-144 413.38,-180&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;365.91&quot; y=&quot;-157.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Application C&lt;/text&gt;
&lt;/g&gt;
&lt;!-- App3&amp;#45;&amp;gt;Comp2 --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;App3-&gt;Comp2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M329.95,-143.52C311.08,-134.34 287.76,-123.01 267.62,-113.22&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;269.3,-110.15 258.78,-108.92 266.24,-116.44 269.3,-110.15&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- App3&amp;#45;&amp;gt;Comp3 --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;App3-&gt;Comp3&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M368.63,-143.7C369.79,-136.32 371.17,-127.52 372.47,-119.25&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;375.89,-120.02 373.99,-109.6 368.98,-118.93 375.89,-120.02&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- DB --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DB&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;255.56,-36 188.26,-36 188.26,0 255.56,0 255.56,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;221.91&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Database&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Comp1&amp;#45;&amp;gt;DB --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Comp1-&gt;DB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M105.63,-71.52C127.45,-61.66 154.82,-49.3 177.51,-39.05&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;178.85,-42.29 186.52,-34.98 175.97,-35.91 178.85,-42.29&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Comp2&amp;#45;&amp;gt;DB --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Comp2-&gt;DB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M221.91,-71.7C221.91,-64.41 221.91,-55.73 221.91,-47.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;225.41,-47.62 221.91,-37.62 218.41,-47.62 225.41,-47.62&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Comp3&amp;#45;&amp;gt;DB --&gt;
&lt;g id=&quot;edge9&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Comp3-&gt;DB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M338.2,-71.52C316.37,-61.66 289.01,-49.3 266.31,-39.05&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;267.85,-35.91 257.3,-34.98 264.97,-42.29 267.85,-35.91&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Components are &lt;strong&gt;independent&lt;/strong&gt; and &lt;strong&gt;self-contained&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Communication happens through &lt;strong&gt;well-defined interfaces&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Promotes &lt;strong&gt;code reuse&lt;/strong&gt; across applications&lt;/li&gt;
&lt;li&gt;Enables &lt;strong&gt;parallel development&lt;/strong&gt; by different teams&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Scale individual components based on demand&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;, &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; (hosts components)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Monolithic architecture (all-in-one)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt; (infrastructure for component communication)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Over-decomposition leads to &lt;strong&gt;distributed monolith&lt;/strong&gt;—too many tiny components with complex dependencies&lt;/li&gt;
&lt;li&gt;Network overhead: Component calls cross process/JVM boundaries (unlike monolithic in-process calls)&lt;/li&gt;
&lt;li&gt;Versioning: Updating a component interface can break all dependent applications&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>compound-name</title>
    <link href="https://animishraa05.github.io/wiki/ejb/compound-name" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/compound-name.md" />
    <summary>The Problem A single atomic name can only identify objects at one level of the hierarchy.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A single atomic name can only identify objects at one level of the hierarchy. How do we refer to objects deep in a tree structure, like &lt;code class=&quot;notranslate&quot;&gt;/usr/people/ed/.cshrc&lt;/code&gt;? We need a way to combine multiple atomic names into a full path.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A compound name is zero or more atomic names combined using a specific syntax (like &lt;code class=&quot;notranslate&quot;&gt;/&lt;/code&gt; in file paths). It represents a full path through the naming hierarchy. Examples: &lt;code class=&quot;notranslate&quot;&gt;/etc/fstab&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;/usr/bin&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;java:comp/env/jdbc&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Atomic names are concatenated with a separator (e.g., &lt;code class=&quot;notranslate&quot;&gt;/&lt;/code&gt; for file-like, &lt;code class=&quot;notranslate&quot;&gt;.&lt;/code&gt; for DNS-like)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;/usr/people/ed&lt;/code&gt; has four atomic names: &lt;code class=&quot;notranslate&quot;&gt;usr&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;people&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;ed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Each level is resolved sequentially: look up &lt;code class=&quot;notranslate&quot;&gt;usr&lt;/code&gt;, then &lt;code class=&quot;notranslate&quot;&gt;people&lt;/code&gt; within &lt;code class=&quot;notranslate&quot;&gt;usr&lt;/code&gt;, then &lt;code class=&quot;notranslate&quot;&gt;ed&lt;/code&gt; within &lt;code class=&quot;notranslate&quot;&gt;people&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;In JNDI, compound names can span multiple naming systems (federation)&lt;/li&gt;
&lt;li&gt;JNDI compound names may use different syntaxes depending on the provider&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;278pt&quot; height=&quot;138pt&quot; viewBox=&quot;0.00 0.00 278.00 138.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 134.4)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-134.4 274,-134.4 274,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- /usr/people/ed/.cshrc --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;/usr/people/ed/.cshrc&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;195.12,-130.4 68.88,-130.4 68.88,-88.8 201.12,-88.8 201.12,-124.4 195.12,-130.4&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;195.12,-130.4 195.12,-124.4&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;201.12,-124.4 195.12,-124.4&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;135&quot; y=&quot;-113.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;/usr/people/ed/.cshrc&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;135&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Compound Name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- usr --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;usr&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;54,-36 0,-36 0,0 54,0 54,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;usr&lt;/text&gt;
&lt;/g&gt;
&lt;!-- /usr/people/ed/.cshrc&amp;#45;&amp;gt;usr --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;/usr/people/ed/.cshrc-&gt;usr&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M110.76,-88.49C94.66,-75.14 73.43,-57.52 56.37,-43.37&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;58.98,-40.98 49.04,-37.29 54.51,-46.37 58.98,-40.98&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;90.97&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1&lt;/text&gt;
&lt;/g&gt;
&lt;!-- people --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;people&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;126,-36 72,-36 72,0 126,0 126,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;99&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;people&lt;/text&gt;
&lt;/g&gt;
&lt;!-- /usr/people/ed/.cshrc&amp;#45;&amp;gt;people --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;/usr/people/ed/.cshrc-&gt;people&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M127.01,-88.71C122.09,-76.47 115.71,-60.58 110.28,-47.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;113.53,-45.79 106.56,-37.81 107.04,-48.4 113.53,-45.79&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;122.66&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ed --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ed&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;198,-36 144,-36 144,0 198,0 198,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;171&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ed&lt;/text&gt;
&lt;/g&gt;
&lt;!-- /usr/people/ed/.cshrc&amp;#45;&amp;gt;ed --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;/usr/people/ed/.cshrc-&gt;ed&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M142.99,-88.71C147.91,-76.47 154.29,-60.58 159.72,-47.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;162.96,-48.4 163.44,-37.81 156.47,-45.79 162.96,-48.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;159.72&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3&lt;/text&gt;
&lt;/g&gt;
&lt;!-- .cshrc --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;.cshrc&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;270,-36 216,-36 216,0 270,0 270,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;243&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;.cshrc&lt;/text&gt;
&lt;/g&gt;
&lt;!-- /usr/people/ed/.cshrc&amp;#45;&amp;gt;.cshrc --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;/usr/people/ed/.cshrc-&gt;.cshrc&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M159.24,-88.49C175.34,-75.14 196.57,-57.52 213.63,-43.37&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;215.49,-46.37 220.96,-37.29 211.02,-40.98 215.49,-46.37&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;202.17&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;4&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Hierarchical&lt;/strong&gt;: Represents a path through the naming tree&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Syntax-dependent&lt;/strong&gt;: Uses provider-specific separator characters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resolved sequentially&lt;/strong&gt;: Each component is looked up in the context of the previous component&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Can span contexts&lt;/strong&gt;: May traverse multiple subcontexts&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JNDI examples&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;java:comp/env/ejb/MyBean&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;jdbc/myDataSource&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../atomic-name&quot; class=&quot;internal alias&quot; data-slug=&quot;atomic-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Atomic Name&lt;/a&gt; — compound names are made of atomic names&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../jndi-binding&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-binding&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Binding&lt;/a&gt; — bindings use compound names for lookup&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi-naming-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-naming-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Naming Concepts&lt;/a&gt; — compound names are a core concept&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi-context&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Context&lt;/a&gt; — contexts resolve compound names&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../subcontext&quot; class=&quot;internal alias&quot; data-slug=&quot;subcontext&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Subcontext&lt;/a&gt; — compound names traverse subcontexts&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Syntax differences&lt;/strong&gt;: LDAP uses commas (&lt;code class=&quot;notranslate&quot;&gt;,&lt;/code&gt;), file system uses slashes (&lt;code class=&quot;notranslate&quot;&gt;/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Escaping&lt;/strong&gt;: Special characters in atomic names may need escaping in compound names&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Absolute vs relative&lt;/strong&gt;: Some compound names are relative to a context&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parsing errors&lt;/strong&gt;: Incorrect syntax causes &lt;code class=&quot;notranslate&quot;&gt;InvalidNameException&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>count-bean-example</title>
    <link href="https://animishraa05.github.io/wiki/ejb/count-bean-example" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/count-bean-example.md" />
    <summary>The Problem Learning EJB concepts abstractly is hard.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Learning EJB concepts abstractly is hard. Students need a concrete, minimal example that demonstrates stateful session beans, passivation/activation, and the full EJB lifecycle in action.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The Count Bean is a simple stateful session bean example that maintains a conversational state (an integer counter &lt;code class=&quot;notranslate&quot;&gt;val&lt;/code&gt;). It demonstrates the full EJB development cycle: remote interface, home interface, bean class, deployment descriptor, and client code.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Remote Interface (&lt;code class=&quot;notranslate&quot;&gt;Count&lt;/code&gt;)&lt;/strong&gt;: Extends &lt;code class=&quot;notranslate&quot;&gt;EJBObject&lt;/code&gt;, declares &lt;code class=&quot;notranslate&quot;&gt;count()&lt;/code&gt; business method that throws &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bean Class (&lt;code class=&quot;notranslate&quot;&gt;CountBean&lt;/code&gt;)&lt;/strong&gt;: Implements &lt;code class=&quot;notranslate&quot;&gt;SessionBean&lt;/code&gt;, has &lt;code class=&quot;notranslate&quot;&gt;val&lt;/code&gt; as conversational state, implements &lt;code class=&quot;notranslate&quot;&gt;count()&lt;/code&gt; to increment and return &lt;code class=&quot;notranslate&quot;&gt;val&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lifecycle Callbacks&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;ejbCreate(int val)&lt;/code&gt; initializes state, &lt;code class=&quot;notranslate&quot;&gt;ejbPassivate()&lt;/code&gt; serializes to storage, &lt;code class=&quot;notranslate&quot;&gt;ejbActivate()&lt;/code&gt; restores from storage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Home Interface (&lt;code class=&quot;notranslate&quot;&gt;CountHome&lt;/code&gt;)&lt;/strong&gt;: Extends &lt;code class=&quot;notranslate&quot;&gt;EJBHome&lt;/code&gt;, declares &lt;code class=&quot;notranslate&quot;&gt;create(int val)&lt;/code&gt; which maps to &lt;code class=&quot;notranslate&quot;&gt;ejbCreate()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deployment Descriptor&lt;/strong&gt;: Declares &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;session-type&gt;Stateful&amp;#x3C;/session-type&gt;&lt;/code&gt; in &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client&lt;/strong&gt;: Looks up Home via JNDI, calls &lt;code class=&quot;notranslate&quot;&gt;home.create(10)&lt;/code&gt;, calls &lt;code class=&quot;notranslate&quot;&gt;count()&lt;/code&gt; to increment&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The example shows passivation when pool limit (2 beans) is reached, then activation when beans are reused.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;360pt&quot; height=&quot;405pt&quot; viewBox=&quot;0.00 0.00 360.00 405.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 400.7)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-400.7 355.84,-400.7 355.84,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_ejb&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-8 8,-317.9 298,-317.9 298,-8 8,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;153&quot; y=&quot;-301.3&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;243,-396.7 189,-396.7 189,-360.7 243,-360.7 243,-396.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;216&quot; y=&quot;-374.5&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home Object --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Home Object&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;105,-282.3 16.2,-264.3 105,-246.3 193.8,-264.3 105,-282.3&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;105&quot; y=&quot;-260.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Home Object&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;Home Object --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;Home Object&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M199.14,-360.63C179.87,-341.11 148.25,-309.09 127.04,-287.61&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;129.77,-285.4 120.26,-280.75 124.79,-290.32 129.77,-285.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;216.46&quot; y=&quot;-330.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI lookup&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CountBean Instance 1 --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CountBean Instance 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M164.5,-190.7C164.5,-190.7 109.5,-190.7 109.5,-190.7 103.5,-190.7 97.5,-184.7 97.5,-178.7 97.5,-178.7 97.5,-161.1 97.5,-161.1 97.5,-155.1 103.5,-149.1 109.5,-149.1 109.5,-149.1 164.5,-149.1 164.5,-149.1 170.5,-149.1 176.5,-155.1 176.5,-161.1 176.5,-161.1 176.5,-178.7 176.5,-178.7 176.5,-184.7 170.5,-190.7 164.5,-190.7&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;137&quot; y=&quot;-174.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CountBean&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;137&quot; y=&quot;-157.3&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;val=10&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;CountBean Instance 1 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;CountBean Instance 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M243.47,-366.25C262.88,-356.52 287.42,-340.51 299,-317.9 314.07,-288.47 316.98,-271.25 299,-243.5 274.6,-205.83 225.54,-187.52 187.77,-178.74&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;188.94,-175.41 178.43,-176.73 187.47,-182.26 188.94,-175.41&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;331.63&quot; y=&quot;-260.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;count()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home Object&amp;#45;&amp;gt;CountBean Instance 1 --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Home Object-&gt;CountBean Instance 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M110.57,-247.21C114.93,-234.64 121.1,-216.81 126.39,-201.55&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;129.58,-203.02 129.54,-192.43 122.96,-200.73 129.58,-203.02&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;152.23&quot; y=&quot;-212.9&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;create(10)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Pool --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Pool&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M166.84,-89C166.84,-93.03 142.26,-96.3 112,-96.3 81.74,-96.3 57.16,-93.03 57.16,-89 57.16,-89 57.16,-23.3 57.16,-23.3 57.16,-19.27 81.74,-16 112,-16 142.26,-16 166.84,-19.27 166.84,-23.3 166.84,-23.3 166.84,-89 166.84,-89&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M166.84,-89C166.84,-84.97 142.26,-81.7 112,-81.7 81.74,-81.7 57.16,-84.97 57.16,-89&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;112&quot; y=&quot;-68.75&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Pool&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;112&quot; y=&quot;-51.95&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(empty or&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;112&quot; y=&quot;-35.15&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;serialized beans)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CountBean Instance 1&amp;#45;&amp;gt;Pool --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CountBean Instance 1-&gt;Pool&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M97.05,-160.84C80.64,-155.35 63.22,-146.21 53.47,-131.1 47.41,-121.71 48.74,-112.06 53.96,-102.97&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;56.74,-105.1 59.77,-94.95 51.07,-101 56.74,-105.1&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;92.73&quot; y=&quot;-118.5&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbPassivate()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CountBean Instance 2 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CountBean Instance 2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M278.5,-285.1C278.5,-285.1 223.5,-285.1 223.5,-285.1 217.5,-285.1 211.5,-279.1 211.5,-273.1 211.5,-273.1 211.5,-255.5 211.5,-255.5 211.5,-249.5 217.5,-243.5 223.5,-243.5 223.5,-243.5 278.5,-243.5 278.5,-243.5 284.5,-243.5 290.5,-249.5 290.5,-255.5 290.5,-255.5 290.5,-273.1 290.5,-273.1 290.5,-279.1 284.5,-285.1 278.5,-285.1&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;251&quot; y=&quot;-268.5&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CountBean&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;251&quot; y=&quot;-251.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;val=20&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Pool&amp;#45;&amp;gt;CountBean Instance 1 --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Pool-&gt;CountBean Instance 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M127.26,-96.76C129.09,-102.58 130.75,-108.55 132,-114.3 133.61,-121.69 134.7,-129.74 135.44,-137.34&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;131.94,-137.55 136.22,-147.24 138.92,-137 131.94,-137.55&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;171.62&quot; y=&quot;-118.5&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbActivate()&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Stateful&lt;/strong&gt;: Maintains conversational state (&lt;code class=&quot;notranslate&quot;&gt;val&lt;/code&gt;) across method calls&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Passivation&lt;/strong&gt;: Bean serialized to storage when pool is full or idle&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Activation&lt;/strong&gt;: Bean restored from storage when needed again&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Serialiable state&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;val&lt;/code&gt; is serialiable (primitive int)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JNDI lookup&lt;/strong&gt;: Client finds Home Object via JNDI, not &lt;code class=&quot;notranslate&quot;&gt;new&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No &lt;code class=&quot;notranslate&quot;&gt;this&lt;/code&gt;&lt;/strong&gt;: Bean uses &lt;code class=&quot;notranslate&quot;&gt;SessionContext.getEJBObject()&lt;/code&gt; to get self-reference&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../stateful-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateful-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateful Session Bean&lt;/a&gt; — CountBean is a stateful bean&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt; — Count interface extends EJBObject&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt; — CountHome is the factory&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../passivation&quot; class=&quot;internal alias&quot; data-slug=&quot;passivation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Passivation&lt;/a&gt; — demonstrated when pool limit reached&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../activation&quot; class=&quot;internal alias&quot; data-slug=&quot;activation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Activation&lt;/a&gt; — demonstrated when bean reused&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-development-lifecycle&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-development-lifecycle&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Development Lifecycle&lt;/a&gt; — full example of the lifecycle&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../session-context&quot; class=&quot;internal alias&quot; data-slug=&quot;session-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;SessionContext&lt;/a&gt; — provides &lt;code class=&quot;notranslate&quot;&gt;getEJBObject()&lt;/code&gt; for self-reference&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../instance-pooling&quot; class=&quot;internal alias&quot; data-slug=&quot;instance-pooling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Instance Pooling&lt;/a&gt; — pool management triggers passivation&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Stateful cannot be pooled&lt;/strong&gt;: Unlike stateless, each client gets dedicated bean&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Passivation failure&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;val&lt;/code&gt; must be serialiable, or passivation fails&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code class=&quot;notranslate&quot;&gt;this&lt;/code&gt; danger&lt;/strong&gt;: Never pass &lt;code class=&quot;notranslate&quot;&gt;this&lt;/code&gt; to other beans—use &lt;code class=&quot;notranslate&quot;&gt;getEJBObject()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pool limit&lt;/strong&gt;: Container-specific setting controls when passivation occurs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server crash&lt;/strong&gt;: Passivated state may be lost if server crashes&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>distributed-objects</title>
    <link href="https://animishraa05.github.io/wiki/ejb/distributed-objects" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/distributed-objects.md" />
    <summary>The Problem Traditional objects live in a single JVM—if you want to call a method on an object running on a different server, you can’t just use object.method().</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="rmi" label="rmi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Traditional objects live in a single JVM—if you want to call a method on an object running on a different server, you can’t just use &lt;code class=&quot;notranslate&quot;&gt;object.method()&lt;/code&gt;. Network programming is complex: you need sockets, serialization, protocol handling, and error recovery.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A distributed object is a Java object running on a remote server, but it can be accessed as if it were local. The EJB container (via RMI-IIOP) handles all network complexity—the client calls methods on a proxy, and the container forwards the call to the actual object on the server.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Server side&lt;/strong&gt;: The EJB object (proxy) is registered with the naming service (JNDI)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client lookup&lt;/strong&gt;: Client uses JNDI to find the home object reference&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proxy creation&lt;/strong&gt;: Home object creates an EJB object (proxy) for the client&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Method invocation&lt;/strong&gt;: Client calls methods on the proxy; proxy forwards via network to the actual bean&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Result return&lt;/strong&gt;: Bean’s response travels back through proxy to client&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: DistributedObjects Pages: 1 --&gt;
&lt;svg width=&quot;782pt&quot; height=&quot;140pt&quot; viewBox=&quot;0.00 0.00 782.00 140.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 136)&quot;&gt;
&lt;title&gt;DistributedObjects&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-136 777.95,-136 777.95,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_client&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-8 8,-124 275.53,-124 275.53,-8 8,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;141.77&quot; y=&quot;-107.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client JVM&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_server&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;453.38,-35 453.38,-118 765.95,-118 765.95,-35 453.38,-35&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;609.67&quot; y=&quot;-101.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server JVM (Container)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;C&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;99.27,-71 16,-71 16,-35 99.27,-35 99.27,-71&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;57.64&quot; y=&quot;-48.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client Code&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Proxy --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Proxy&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;267.53,-67.8 187.38,-67.8 187.38,-26.2 267.53,-26.2 267.53,-67.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;227.45&quot; y=&quot;-51.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;227.45&quot; y=&quot;-34.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Proxy)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C&amp;#45;&amp;gt;Proxy --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;C-&gt;Proxy&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M99.61,-38.9C105.48,-37.37 111.48,-36.06 117.27,-35.2 140.18,-31.8 146.34,-32.84 169.38,-35.2 171.44,-35.41 173.54,-35.66 175.65,-35.95&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;175.09,-39.4 185.51,-37.52 176.19,-32.49 175.09,-39.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;143.32&quot; y=&quot;-39.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. hello()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Proxy&amp;#45;&amp;gt;C --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Proxy-&gt;C&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M187.18,-50.85C181.22,-51.31 175.14,-51.72 169.38,-52 150.38,-52.92 129.53,-53.27 111.1,-53.37&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;111.18,-49.87 101.19,-53.39 111.2,-56.87 111.18,-49.87&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;143.32&quot; y=&quot;-57.52&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;5. Return&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Home&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;552.41,-84.8 461.38,-84.8 461.38,-43.2 552.41,-43.2 552.41,-84.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;506.9&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Home Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;506.9&quot; y=&quot;-51.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Factory)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Proxy&amp;#45;&amp;gt;Home --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Proxy-&gt;Home&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M267.91,-49.42C315.44,-52.33 395.61,-57.24 449.62,-60.55&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;449.35,-64.04 459.55,-61.16 449.78,-57.06 449.35,-64.04&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;364.46&quot; y=&quot;-64.09&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Network call (RMI-IIOP)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;757.95,-84.8 652.16,-84.8 652.16,-43.2 757.95,-43.2 757.95,-84.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;705.05&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Enterprise Bean&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;705.05&quot; y=&quot;-51.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Actual Object)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home&amp;#45;&amp;gt;Bean --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Home-&gt;Bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M552.9,-64C578.96,-64 612.18,-64 640.83,-64&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;640.46,-67.5 650.46,-64 640.46,-60.5 640.46,-67.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;602.28&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. Delegate&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;Proxy --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;Proxy&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M651.97,-43.69C623.12,-33.52 586.33,-22.31 552.41,-17.2 456.26,-2.7 342.92,-21.18 278.99,-34.84&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;278.53,-31.36 269.51,-36.92 280.02,-38.2 278.53,-31.36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;506.9&quot; y=&quot;-21.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;4. Result&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Objects can be &lt;strong&gt;accessed across network boundaries&lt;/strong&gt; (different machines, different JVMs)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Location transparency&lt;/strong&gt;: Client doesn’t know or care where the object physically lives&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RMI-IIOP protocol&lt;/strong&gt;: Standard wire protocol for EJB distributed objects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proxy pattern&lt;/strong&gt;: Client never talks directly to the bean—always through EJB object&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../rmi-remote-method-invocation&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-remote-method-invocation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI&lt;/a&gt;, &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt;, &lt;a href=&quot;../../ejb-naming-service&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-naming-service&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Naming Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../ejb-object&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-object&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Object&lt;/a&gt;, &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt;, &lt;a href=&quot;../../distributed-objects&quot; class=&quot;internal alias&quot; data-slug=&quot;distributed-objects&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Distributed Objects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt; (handles network complexity), &lt;a href=&quot;../../location-transparency&quot; class=&quot;internal alias&quot; data-slug=&quot;location-transparency&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Location Transparency&lt;/a&gt; (clients don’t know object location)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Local objects (in-process, no network overhead), &lt;a href=&quot;../../local-home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;local-home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Local Home Interface&lt;/a&gt; (same JVM, no RMI)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Network failures&lt;/strong&gt;: Remote exceptions (&lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;) can occur—not present with local objects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Serialization overhead&lt;/strong&gt;: Parameters must be serializable for network transfer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Latency&lt;/strong&gt;: Network calls are 100-1000x slower than in-process calls&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stateless beans preferred for distributed access&lt;/strong&gt;: No client-specific state to transfer&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dont-rely-on-ejbremove</title>
    <link href="https://animishraa05.github.io/wiki/ejb/dont-rely-on-ejbremove" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/dont-rely-on-ejbremove.md" />
    <summary>The Problem Developers often put critical cleanup code in ejbRemove()—closing database connections, deleting temporary shopping cart data, etc.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Developers often put critical cleanup code in &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt;—closing database connections, deleting temporary shopping cart data, etc. But what if &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; is never called?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The EJB container MAY call &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; when it decides to destroy a bean instance. BUT it is NOT guaranteed. If the server crashes, or if a critical system exception occurs, the bean is destroyed without &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; being called. Never rely on &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; for critical cleanup.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Normal case&lt;/strong&gt;: Container calls &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; when client calls &lt;code class=&quot;notranslate&quot;&gt;remove()&lt;/code&gt; or when bean times out&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Crash case&lt;/strong&gt;: Server crashes → &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; never called → resources leaked&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exception case&lt;/strong&gt;: System exception occurs → container discards bean → &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; may not be called&lt;/li&gt;
&lt;/ul&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Use external cleanup utilities (e.g., a periodic job that deletes abandoned shopping carts from the database).&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: EjbRemove Pages: 1 --&gt;
&lt;svg width=&quot;453pt&quot; height=&quot;127pt&quot; viewBox=&quot;0.00 0.00 453.00 127.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 123.2)&quot;&gt;
&lt;title&gt;EjbRemove&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-123.2 448.76,-123.2 448.76,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Normal --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Normal&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;134.18,-119.2 0,-119.2 0,-77.6 134.18,-77.6 134.18,-119.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67.09&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Normal Scenario&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67.09&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client calls remove()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C1 --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;C1&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;117.27,-41.6 16.91,-41.6 16.91,0 117.27,0 117.27,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67.09&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Container calls&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67.09&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbRemove()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Normal&amp;#45;&amp;gt;C1 --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Normal-&gt;C1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M67.09,-77.14C67.09,-69.79 67.09,-61.31 67.09,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;70.59,-53.37 67.09,-43.37 63.59,-53.37 70.59,-53.37&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Crash --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Crash&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;253.66,-119.2 152.52,-119.2 152.52,-77.6 253.66,-77.6 253.66,-119.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;203.09&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Crash Scenario&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;203.09&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server crashes&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C2 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;C2&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;263.78,-41.6 142.4,-41.6 142.4,0 263.78,0 263.78,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;203.09&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbRemove()&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;203.09&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NEVER CALLED&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Crash&amp;#45;&amp;gt;C2 --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Crash-&gt;C2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M203.09,-77.14C203.09,-69.79 203.09,-61.31 203.09,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;206.59,-53.37 203.09,-43.37 199.59,-53.37 206.59,-53.37&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Exception --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Exception&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;442.25,-119.2 283.93,-119.2 283.93,-77.6 442.25,-77.6 442.25,-119.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;363.09&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Exception Scenario&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;363.09&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;System exception thrown&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C3 --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;C3&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;444.76,-41.6 281.42,-41.6 281.42,0 444.76,0 444.76,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;363.09&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Container discards bean&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;363.09&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;May not call ejbRemove()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Exception&amp;#45;&amp;gt;C3 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Exception-&gt;C3&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M363.09,-77.14C363.09,-69.79 363.09,-61.31 363.09,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;366.59,-53.37 363.09,-43.37 359.59,-53.37 366.59,-53.37&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Not a destructor&lt;/strong&gt;: Unlike C++ destructors, &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; is not guaranteed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container’s choice&lt;/strong&gt;: EJB spec allows container to skip &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; in some cases&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Periodic cleanup needed&lt;/strong&gt;: For resources that MUST be cleaned (like temp DB records), use a scheduled job&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Session beans&lt;/strong&gt;: Stateless beans may be destroyed without &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; (pool management)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;, &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt; (both have &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; (decides when to call it)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../application-vs-system-exceptions&quot; class=&quot;internal alias&quot; data-slug=&quot;application-vs-system-exceptions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;System Exceptions&lt;/a&gt; (can bypass &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Java &lt;code class=&quot;notranslate&quot;&gt;finalize()&lt;/code&gt; (also unreliable), C++ destructors (reliable)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Shopping cart example&lt;/strong&gt;: If &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt; isn’t called, abandoned carts stay in DB forever—need a cleanup job&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Database connections&lt;/strong&gt;: Don’t close them in &lt;code class=&quot;notranslate&quot;&gt;ejbRemove()&lt;/code&gt;—use &lt;code class=&quot;notranslate&quot;&gt;ejbPassivate()&lt;/code&gt; or let container manage pooling&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exam trick question&lt;/strong&gt;: “Where should you put critical cleanup code?” → Answer: Nowhere in the bean—use external utilities&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejb-client-jar</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-client-jar" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-client-jar.md" />
    <summary>The Problem Clients need the EJB interfaces and stubs to call beans.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Clients need the EJB interfaces and stubs to call beans. But giving them the full EJB-JAR (which includes your business logic/bean class) is a security risk and wastes disk space. How can you give clients only what they need?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The optional EJB Client JAR is a smaller archive containing only the files clients need: interfaces (Home, Remote/Local), helper classes, and generated stubs. You specify it in the deployment descriptor with &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;ejb-client-jar&gt;HelloClient.jar&amp;#x3C;/ejb-client-jar&gt;&lt;/code&gt;. Clients deploy just this JAR, not the entire EJB-JAR.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Developer creates Client JAR&lt;/strong&gt;: Bundles interfaces + stubs + helpers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Declare in XML&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;ejb-client-jar&gt;&lt;/code&gt; tag in &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deployer gives Client JAR to clients&lt;/strong&gt;: Clients add it to their classpath&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client uses JAR&lt;/strong&gt;: Can lookup and call beans without having bean implementation&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: ClientJAR Pages: 1 --&gt;
&lt;svg width=&quot;589pt&quot; height=&quot;218pt&quot; viewBox=&quot;0.00 0.00 589.00 218.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 214)&quot;&gt;
&lt;title&gt;ClientJAR&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-214 585,-214 585,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_full&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-8 8,-202 287,-202 287,-8 8,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;147.5&quot; y=&quot;-185.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Full EJB-JAR (Server)&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_client&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;295,-8 295,-84.8 573,-84.8 573,-8 295,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;434&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Client JAR (Client)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;117.56,-169.2 16.44,-169.2 16.44,-127.6 117.56,-127.6 117.56,-169.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67&quot; y=&quot;-152.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bean Class&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67&quot; y=&quot;-135.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Secret Logic!)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- XML --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;XML&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;105.91,-52 28.09,-52 28.09,-16 105.91,-16 105.91,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejb-jar.xml&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;XML --&gt;
&lt;!-- Intf --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Intf&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;206.59,-166.4 135.41,-166.4 135.41,-130.4 206.59,-130.4 206.59,-166.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;171&quot; y=&quot;-144.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Interfaces&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CIntf --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CIntf&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;374.59,-52 303.41,-52 303.41,-16 374.59,-16 374.59,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;339&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Interfaces&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Intf&amp;#45;&amp;gt;CIntf --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Intf-&gt;CIntf&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M192.37,-129.9C208.24,-117.76 230.91,-102.15 253.18,-92.8 269.02,-86.15 275.97,-93.13 291,-84.8 301.71,-78.86 311.51,-69.75 319.42,-60.94&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;321.91,-63.41 325.69,-53.51 316.56,-58.89 321.91,-63.41&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;312.09&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Copied to client JAR&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Stubs --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Stubs&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;279,-166.4 225,-166.4 225,-130.4 279,-130.4 279,-166.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252&quot; y=&quot;-144.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Stubs&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CStubs --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CStubs&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;447,-52 393,-52 393,-16 447,-16 447,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;420&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Stubs&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Stubs&amp;#45;&amp;gt;CStubs --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Stubs-&gt;CStubs&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M279.46,-144.04C305.27,-139.72 343.88,-130.16 371,-109.6 387.05,-97.43 399.44,-78.38 407.74,-62.58&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;410.87,-64.16 412.16,-53.64 404.59,-61.06 410.87,-64.16&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;445.58&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Copied to client JAR&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CHelpers --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CHelpers&lt;/title&gt;
&lt;polygon fill=&quot;lightgrey&quot; stroke=&quot;black&quot; points=&quot;564.79,-52 465.21,-52 465.21,-16 564.79,-16 564.79,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;515&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Helper Classes&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Optional&lt;/strong&gt;: Most deployments don’t use it (hard disk space is cheap)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: Hides business logic implementation from clients&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Smaller footprint&lt;/strong&gt;: Useful for applets or disk-constrained environments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Declared in deployment descriptor&lt;/strong&gt;: Container tells deployer which JAR to create&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt;, &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt; (included in client JAR)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; (client uses JAR to lookup beans)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ejb-jar-file&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-jar-file&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB-JAR File&lt;/a&gt; (the full version)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Full EJB-JAR (includes secret bean implementation)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Mostly obsolete&lt;/strong&gt;: Modern deployments use Web Services or REST—not EJB direct clients&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Laziness prevails&lt;/strong&gt;: Most deployers just give clients the full EJB-JAR (easier)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Applet environment&lt;/strong&gt;: Only critical use case—applets have very limited disk space&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejb-context</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-context" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-context.md" />
    <summary>The Problem Enterprise beans live inside a managed container.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Enterprise beans live inside a managed container. Sometimes the bean needs to query the container—“Who is the current user?”, “Is this transaction going to rollback?”, “What’s my home object?”. But beans shouldn’t directly access container internals.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;code class=&quot;notranslate&quot;&gt;EJBContext&lt;/code&gt; is the bean’s gateway to the container. It’s an object that encapsulates everything the bean needs to know about its environment. The container injects this context (via &lt;code class=&quot;notranslate&quot;&gt;setSessionContext()&lt;/code&gt; or &lt;code class=&quot;notranslate&quot;&gt;setEntityContext()&lt;/code&gt;), and the bean can query it at any time.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The container calls &lt;code class=&quot;notranslate&quot;&gt;setSessionContext(SessionContext ctx)&lt;/code&gt; during bean creation. The bean stores this reference. Later, the bean can use it:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;getCallerPrincipal()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;isCallerInRole(String role)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transactions&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;getRollbackOnly()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;setRollbackOnly()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;getUserTransaction()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Home access&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;getEJBHome()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;getEJBLocalHome()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: EJBContext Pages: 1 --&gt;
&lt;svg width=&quot;549pt&quot; height=&quot;178pt&quot; viewBox=&quot;0.00 0.00 549.00 178.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 173.6)&quot;&gt;
&lt;title&gt;EJBContext&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-173.6 545.42,-173.6 545.42,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Container --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Container&lt;/title&gt;
&lt;path fill=&quot;lightgrey&quot; stroke=&quot;black&quot; d=&quot;M157.95,-163.53C157.95,-165.33 135.98,-166.8 108.93,-166.8 81.88,-166.8 59.91,-165.33 59.91,-163.53 59.91,-163.53 59.91,-134.07 59.91,-134.07 59.91,-132.27 81.88,-130.8 108.93,-130.8 135.98,-130.8 157.95,-132.27 157.95,-134.07 157.95,-134.07 157.95,-163.53 157.95,-163.53&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M157.95,-163.53C157.95,-161.72 135.98,-160.25 108.93,-160.25 81.88,-160.25 59.91,-161.72 59.91,-163.53&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;108.93&quot; y=&quot;-144.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Ctx --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Ctx&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;268.25,-75.2 163.61,-75.2 163.61,0 268.25,0 268.25,-75.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;215.93&quot; y=&quot;-58.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJBContext&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;215.93&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;- Security&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;215.93&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;- Transactions&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;215.93&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;- Home Objects&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container&amp;#45;&amp;gt;Ctx --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container-&gt;Ctx&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M59.58,-139.66C24.48,-131.66 -13.43,-117.12 5.08,-93.2 23.05,-69.98 96.82,-54.84 152.06,-46.52&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;152.31,-50.02 161.7,-45.12 151.3,-43.1 152.31,-50.02&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;66.5&quot; y=&quot;-97.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. Creates &amp;#x26; manages&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Ctx&amp;#45;&amp;gt;Container --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Ctx-&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M173.5,-75.49C167.26,-81.28 161.02,-87.31 155.29,-93.2 146.59,-102.16 137.57,-112.51 129.83,-121.76&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;127.2,-119.45 123.54,-129.39 132.6,-123.91 127.2,-119.45&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;210.11&quot; y=&quot;-97.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;4. Callback for info&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;404.81,-169.6 241.05,-169.6 241.05,-128 404.81,-128 404.81,-169.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;322.93&quot; y=&quot;-153&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Enterprise Bean&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;322.93&quot; y=&quot;-136.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(SessionBean/EntityBean)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;Ctx --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;Ctx&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M301.67,-127.56C295.84,-121.92 289.55,-115.76 283.83,-110 275.53,-101.62 266.77,-92.58 258.4,-83.83&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;261.01,-81.49 251.57,-76.67 255.94,-86.32 261.01,-81.49&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;355.38&quot; y=&quot;-97.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. setSessionContext(ctx)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;Ctx --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;Ctx&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M405,-129.9C426.01,-121.42 439.54,-109.49 426.93,-93.2 408.94,-69.97 335.13,-54.83 279.84,-46.51&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;280.6,-43.09 270.2,-45.11 279.59,-50.01 280.6,-43.09&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;486.6&quot; y=&quot;-97.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. Query at runtime&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Callback injection&lt;/strong&gt;: Container injects context via &lt;code class=&quot;notranslate&quot;&gt;setSessionContext()&lt;/code&gt;—never created by bean&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamic&lt;/strong&gt;: Context changes over bean’s lifecycle (e.g., transaction status changes)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two types&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;SessionContext&lt;/code&gt; (for session beans), &lt;code class=&quot;notranslate&quot;&gt;EntityContext&lt;/code&gt; (for entity beans)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment bridge&lt;/strong&gt;: Bean can access JNDI environment entries via context&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; (provides the context)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Transactions&lt;/a&gt; (via &lt;code class=&quot;notranslate&quot;&gt;setRollbackOnly()&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;, &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Regular Java objects (no container, no context)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Don’t store context in static variables&lt;/strong&gt;: Context is per-bean-instance, static is shared&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context valid only inside container&lt;/strong&gt;: Can’t use it outside container-managed methods&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Null check&lt;/strong&gt;: Always check if context is set before using (during &lt;code class=&quot;notranslate&quot;&gt;ejbCreate()&lt;/code&gt; it’s already set)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;code-example&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Code Example&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#code-example&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HelloBean&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; implements&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; SessionBean&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    private&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; SessionContext ctx;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt; &lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; setSessionContext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(SessionContext &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;ctx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        this&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.ctx &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ctx;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt; &lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; String &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;hello&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;        // Who is calling?&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        Principal caller &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ctx.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;getCallerPrincipal&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;        // Am I in a transaction that will rollback?&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        boolean&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; rollback &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ctx.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;getRollbackOnly&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;Hello, &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; +&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; caller.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
  </entry><entry>
    <title>ejb-development-lifecycle</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-development-lifecycle" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-development-lifecycle.md" />
    <summary>The Problem Building an EJB component involves more than just writing Java code.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Building an EJB component involves more than just writing Java code. You need to compile, package, configure, and deploy—missing any step results in a non-functional component. What’s the correct order?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The EJB development lifecycle is an 8-step process from raw Java files to a running, tested component in the container. Each step has a specific purpose and must be done in order.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Write Java files&lt;/strong&gt;: Component interfaces, home interfaces, bean class, helper classes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Write deployment descriptor&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt; with bean metadata (or use IDE/XDoclet to generate)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compile&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;javac&lt;/code&gt; to convert &lt;code class=&quot;notranslate&quot;&gt;.java&lt;/code&gt; → &lt;code class=&quot;notranslate&quot;&gt;.class&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create EJB-JAR&lt;/strong&gt;: Use &lt;code class=&quot;notranslate&quot;&gt;jar&lt;/code&gt; utility to package &lt;code class=&quot;notranslate&quot;&gt;.class&lt;/code&gt; files + &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deploy&lt;/strong&gt;: Copy JAR to container’s deployment folder or use vendor tools&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure&lt;/strong&gt;: Set database connections, thread pools via vendor console/config files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start container&lt;/strong&gt;: Verify the JAR loaded successfully&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test&lt;/strong&gt;: Write a client, generate stubs, compile, run, and verify&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: EJBLifecycle Pages: 1 --&gt;
&lt;svg width=&quot;174pt&quot; height=&quot;604pt&quot; viewBox=&quot;0.00 0.00 174.00 604.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 600.4)&quot;&gt;
&lt;title&gt;EJBLifecycle&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-600.4 170.08,-600.4 170.08,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- S1 --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S1&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;155.96,-596.4 10.11,-596.4 10.11,-554.8 155.96,-554.8 155.96,-596.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-579.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. Write .java files&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-563&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Bean, Home, Remote)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S2 --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S2&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;161.6,-517.8 4.48,-517.8 4.48,-476.2 161.6,-476.2 161.6,-517.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-501.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Write ejb-jar.xml&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-484.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Deployment Descriptor)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S1&amp;#45;&amp;gt;S2 --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S1-&gt;S2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.04,-554.47C83.04,-546.88 83.04,-538.05 83.04,-529.66&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.54,-529.77 83.04,-519.77 79.54,-529.77 86.54,-529.77&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- S3 --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S3&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;161.41,-439.2 4.66,-439.2 4.66,-403.2 161.41,-403.2 161.41,-439.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-417&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. Compile .java → .class&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S2&amp;#45;&amp;gt;S3 --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S2-&gt;S3&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.04,-475.83C83.04,-468.06 83.04,-459.03 83.04,-450.62&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.54,-450.85 83.04,-440.85 79.54,-450.85 86.54,-450.85&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- S4 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S4&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;131.26,-366.2 34.81,-366.2 34.81,-324.6 131.26,-324.6 131.26,-366.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-349.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;4. jar utility&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-332.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Create .jar file&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S3&amp;#45;&amp;gt;S4 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S3-&gt;S4&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.04,-402.71C83.04,-395.35 83.04,-386.55 83.04,-378.12&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.54,-378.15 83.04,-368.15 79.54,-378.15 86.54,-378.15&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- S5 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S5&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;166.08,-271.8 0,-271.8 0,-235.8 166.08,-235.8 166.08,-271.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-249.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;5. Deploy .jar to Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S4&amp;#45;&amp;gt;S5 --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S4-&gt;S5&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M81.67,-324.18C81.13,-313.89 80.71,-301.18 81.04,-289.8 81.1,-287.74 81.17,-285.62 81.27,-283.49&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;84.75,-283.92 81.77,-273.75 77.76,-283.56 84.75,-283.92&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- S4&amp;#45;&amp;gt;S5 --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S4-&gt;S5&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.04,-324.51C83.04,-312.52 83.04,-297.02 83.04,-283.68&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.54,-283.72 83.04,-273.72 79.54,-283.72 86.54,-283.72&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;113.55&quot; y=&quot;-294&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Ejb-jar file&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S6 --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S6&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;146.44,-198.8 19.64,-198.8 19.64,-157.2 146.44,-157.2 146.44,-198.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-182.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;6. Configure Server&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-165.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(DB, Threads)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S5&amp;#45;&amp;gt;S6 --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S5-&gt;S6&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.04,-235.31C83.04,-227.95 83.04,-219.15 83.04,-210.72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.54,-210.75 83.04,-200.75 79.54,-210.75 86.54,-210.75&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- S7 --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S7&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;140.61,-120.2 25.46,-120.2 25.46,-78.6 140.61,-78.6 140.61,-120.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-103.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;7. Start Container&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Verify Load&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S6&amp;#45;&amp;gt;S7 --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S6-&gt;S7&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.04,-156.87C83.04,-149.28 83.04,-140.45 83.04,-132.06&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.54,-132.17 83.04,-122.17 79.54,-132.17 86.54,-132.17&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- S8 --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S8&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;129.92,-41.6 36.16,-41.6 36.16,0 129.92,0 129.92,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;8. Test Client&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;83.04&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Run &amp;#x26; Verify&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S7&amp;#45;&amp;gt;S8 --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;S7-&gt;S8&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.04,-78.27C83.04,-70.68 83.04,-61.85 83.04,-53.46&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.54,-53.57 83.04,-43.57 79.54,-53.57 86.54,-53.57&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Standardized process&lt;/strong&gt;: Every EJB component follows these steps (vendor-neutral)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 5 is vendor-specific&lt;/strong&gt;: Each container has its own deployment mechanism&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 6 is vendor-specific&lt;/strong&gt;: Configuration differs (Web console vs config files)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deployment descriptor is key&lt;/strong&gt;: Tells container how to manage the bean&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../ejb-deployment-descriptor&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-deployment-descriptor&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Deployment Descriptor&lt;/a&gt;, &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt;, &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../ejb-object&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-object&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Object&lt;/a&gt; (generated in step 5), &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ejb-jar-file&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-jar-file&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB-JAR File&lt;/a&gt; (output of step 4)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Simple Java app (just compile and run—no deployment descriptor needed)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Forgetting step 2&lt;/strong&gt;: Without &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;, container doesn’t know about your beans&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classpath issues&lt;/strong&gt;: Step 3 needs EJB APIs (javax.ejb.*) in classpath&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor tools automate&lt;/strong&gt;: Modern IDEs (Eclipse, IntelliJ) automate steps 2-4&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejb-jar-file</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-jar-file" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-jar-file.md" />
    <summary>The Problem You’ve written your bean class, interfaces, and deployment descriptor.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;You’ve written your bean class, interfaces, and deployment descriptor. How do you package them for deployment to any EJB container? You need a standard format that bundles everything together.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The EJB-JAR file is a standard Java archive (&lt;code class=&quot;notranslate&quot;&gt;.jar&lt;/code&gt;) containing all the classes (bean class, home/remote/local interfaces, helpers) plus the &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt; deployment descriptor. This single file is what you deploy to the container—it’s vendor-neutral and portable.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Compile&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;javac&lt;/code&gt; converts &lt;code class=&quot;notranslate&quot;&gt;.java&lt;/code&gt; → &lt;code class=&quot;notranslate&quot;&gt;.class&lt;/code&gt; for all your files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Package&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;jar cvf MyBean.jar *.class ejb-jar.xml&lt;/code&gt; creates the archive&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deploy&lt;/strong&gt;: Copy JAR to container’s deployment folder or use vendor tools&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container verifies&lt;/strong&gt;: Checks the JAR structure and generates EJB Object/Home Object&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: EJbJar Pages: 1 --&gt;
&lt;svg width=&quot;468pt&quot; height=&quot;312pt&quot; viewBox=&quot;0.00 0.00 468.00 312.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 308.2)&quot;&gt;
&lt;title&gt;EJbJar&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-308.2 464,-308.2 464,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_sources&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-219.4 8,-296.2 452,-296.2 452,-219.4 8,-219.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;230&quot; y=&quot;-279.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Source Files&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_container&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;205,-8 205,-90.4 299,-90.4 299,-8 205,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252&quot; y=&quot;-73.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;122.29,-263.4 15.71,-263.4 15.71,-227.4 122.29,-227.4 122.29,-263.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;69&quot; y=&quot;-241.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HelloBean.class&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAR --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAR&lt;/title&gt;
&lt;path fill=&quot;orange&quot; stroke=&quot;black&quot; d=&quot;M313.84,-185.2C313.84,-188.07 286.12,-190.4 252,-190.4 217.88,-190.4 190.16,-188.07 190.16,-185.2 190.16,-185.2 190.16,-138.4 190.16,-138.4 190.16,-135.53 217.88,-133.2 252,-133.2 286.12,-133.2 313.84,-135.53 313.84,-138.4 313.84,-138.4 313.84,-185.2 313.84,-185.2&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M313.84,-185.2C313.84,-182.33 286.12,-180 252,-180 217.88,-180 190.16,-182.33 190.16,-185.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252&quot; y=&quot;-166&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;MyBean.jar&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252&quot; y=&quot;-149.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Standard Archive)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;JAR --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;JAR&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M107.81,-227.09C129.76,-217.31 157.84,-204.79 183.38,-193.4&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;184.68,-196.65 192.39,-189.38 181.83,-190.26 184.68,-196.65&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Home --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Home&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;252.02,-263.4 139.98,-263.4 139.98,-227.4 252.02,-227.4 252.02,-263.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;196&quot; y=&quot;-241.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HelloHome.class&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home&amp;#45;&amp;gt;JAR --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Home-&gt;JAR&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M207.88,-227.09C213.32,-219.17 219.99,-209.44 226.49,-199.98&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;229.24,-202.15 232.01,-191.92 223.47,-198.19 229.24,-202.15&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Remote --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Remote&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;347.91,-263.4 270.09,-263.4 270.09,-227.4 347.91,-227.4 347.91,-263.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;309&quot; y=&quot;-241.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Hello.class&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Remote&amp;#45;&amp;gt;JAR --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Remote-&gt;JAR&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M296.91,-227.09C291.37,-219.17 284.58,-209.44 277.97,-199.98&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;280.93,-198.11 272.34,-191.92 275.2,-202.12 280.93,-198.11&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- XML --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;XML&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;443.91,-263.4 366.09,-263.4 366.09,-227.4 443.91,-227.4 443.91,-263.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;405&quot; y=&quot;-241.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejb-jar.xml&lt;/text&gt;
&lt;/g&gt;
&lt;!-- XML&amp;#45;&amp;gt;JAR --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;XML-&gt;JAR&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M372.55,-227.09C354.91,-217.69 332.53,-205.75 311.86,-194.72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;313.68,-191.73 303.21,-190.11 310.38,-197.91 313.68,-191.73&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Verified --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Verified&lt;/title&gt;
&lt;polygon fill=&quot;lightgrey&quot; stroke=&quot;black&quot; points=&quot;290.52,-57.6 213.48,-57.6 213.48,-16 290.52,-16 290.52,-57.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252&quot; y=&quot;-41&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Verified &amp;#x26;&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252&quot; y=&quot;-24.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Generated&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAR&amp;#45;&amp;gt;Verified --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAR-&gt;Verified&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M252,-132.89C252,-113.99 252,-88.98 252,-69.36&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;255.5,-69.45 252,-59.45 248.5,-69.45 255.5,-69.45&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272.61&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Deploy&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Standard format&lt;/strong&gt;: Any EJB container can read an EJB-JAR file&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contains&lt;/strong&gt;: Classes + &lt;code class=&quot;notranslate&quot;&gt;META-INF/ejb-jar.xml&lt;/code&gt; (deployment descriptor)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional&lt;/strong&gt;: May include &lt;code class=&quot;notranslate&quot;&gt;META-INF/webservices.xml&lt;/code&gt; or vendor-specific files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor-neutral&lt;/strong&gt;: Write once, deploy on any EJB container&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt;, &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt;, &lt;a href=&quot;../../ejb-deployment-descriptor&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-deployment-descriptor&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Deployment Descriptor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../ejb-verification-generation&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-verification-generation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Verification &amp;#x26; Generation&lt;/a&gt; (container processes the JAR)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ejb-client-jar&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-client-jar&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Client JAR&lt;/a&gt; (subset of files for clients)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Regular JAR (no &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;, not deployable to EJB container)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Missing &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;&lt;/strong&gt;: Container rejects the JAR—deployment fails&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classpath issues&lt;/strong&gt;: All dependencies must be in the JAR or server classpath&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor-specific files&lt;/strong&gt;: Some containers need extra files in &lt;code class=&quot;notranslate&quot;&gt;META-INF/&lt;/code&gt; (e.g., &lt;code class=&quot;notranslate&quot;&gt;weblogic-ejb-jar.xml&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejb-naming-service</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-naming-service" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-naming-service.md" />
    <summary>The Problem Clients need to find Home Objects to create beans.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Clients need to find Home Objects to create beans. But hardcoding server addresses in client code creates tight coupling—if the server moves, all clients break. What’s the solution?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;EJB uses naming and directory services (via JNDI) to store and look up resources (Home Objects, environment properties, database drivers) by logical name (nickname), not physical address. Clients use &lt;code class=&quot;notranslate&quot;&gt;ctx.lookup(&quot;HelloHome&quot;)&lt;/code&gt; to find Home Objects—the naming service resolves the actual location.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Deployer binds nickname&lt;/strong&gt;: Container registers Home Object with JNDI using a name (e.g., &lt;code class=&quot;notranslate&quot;&gt;&quot;HelloHome&quot;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client sets up JNDI properties&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;Context.INITIAL_CONTEXT_FACTORY&lt;/code&gt; + &lt;code class=&quot;notranslate&quot;&gt;Context.PROVIDER_URL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client looks up&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;ctx.lookup(&quot;HelloHome&quot;)&lt;/code&gt; → JNDI returns Home Object reference&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Naming service types&lt;/strong&gt;: LDAP, CORBA Naming Service (COS Naming), or in-process JNDI tree&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: NamingService Pages: 1 --&gt;
&lt;svg width=&quot;469pt&quot; height=&quot;279pt&quot; viewBox=&quot;0.00 0.00 469.00 279.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 275.2)&quot;&gt;
&lt;title&gt;NamingService&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-275.2 464.78,-275.2 464.78,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_jndi&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;54.78,-180.8 54.78,-263.2 452.78,-263.2 452.78,-180.8 54.78,-180.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;253.78&quot; y=&quot;-246.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI Naming Service&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;161.56,-41.6 0,-41.6 0,0 161.56,0 161.56,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;80.78&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client Code&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;80.78&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ctx.lookup(&quot;HelloHome&quot;)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LDAP&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;173.21,-230.4 62.35,-230.4 62.35,-188.8 173.21,-188.8 173.21,-230.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;117.78&quot; y=&quot;-213.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LDAP&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;117.78&quot; y=&quot;-197&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ldap://server:389&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;LDAP --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;LDAP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M75.44,-42.03C70.23,-65.2 64.31,-104.06 73.31,-136 77.66,-151.42 86.29,-166.79 94.81,-179.4&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;91.71,-181.08 100.35,-187.22 97.42,-177.03 91.71,-181.08&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;131.05&quot; y=&quot;-111&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. Lookup nickname&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Home&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;289.3,-136 198.27,-136 198.27,-94.4 289.3,-94.4 289.3,-136&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;243.78&quot; y=&quot;-119.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Home Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;243.78&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HelloHome&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP&amp;#45;&amp;gt;Home --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;LDAP-&gt;Home&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M145.43,-188.32C163.49,-175.08 187.27,-157.64 206.92,-143.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;208.98,-146.06 214.97,-137.33 204.84,-140.42 208.98,-146.06&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;256.59&quot; y=&quot;-158.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Resolve to reference&lt;/text&gt;
&lt;/g&gt;
&lt;!-- COS --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;COS&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;318.38,-230.4 191.18,-230.4 191.18,-188.8 318.38,-188.8 318.38,-230.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;254.78&quot; y=&quot;-213.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;COS Naming&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;254.78&quot; y=&quot;-197&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;corbaloc::host:3700&lt;/text&gt;
&lt;/g&gt;
&lt;!-- InProc --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;InProc&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;445.25,-230.4 336.32,-230.4 336.32,-188.8 445.25,-188.8 445.25,-230.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;390.78&quot; y=&quot;-213.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;In-Process JNDI&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;390.78&quot; y=&quot;-197&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(container JVM)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home&amp;#45;&amp;gt;Client --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Home-&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M208.01,-93.92C184.02,-80.32 152.21,-62.29 126.4,-47.66&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;128.21,-44.66 117.79,-42.78 124.76,-50.75 128.21,-44.66&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;230.71&quot; y=&quot;-63.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. Return reference&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Location transparency&lt;/strong&gt;: Client doesn’t know physical server address&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standard API&lt;/strong&gt;: JNDI (&lt;code class=&quot;notranslate&quot;&gt;javax.naming.*&lt;/code&gt;) works with any naming service&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JNDI properties&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;INITIAL_CONTEXT_FACTORY&lt;/code&gt; (e.g., &lt;code class=&quot;notranslate&quot;&gt;com.sun.jndi.ldap.LdapCtxFactory&lt;/code&gt;) + &lt;code class=&quot;notranslate&quot;&gt;PROVIDER_URL&lt;/code&gt; (e.g., &lt;code class=&quot;notranslate&quot;&gt;ldap://louvre:389&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Beyond Home Objects&lt;/strong&gt;: Also stores environment properties, database resources, message queues&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt;, &lt;a href=&quot;../../location-transparency&quot; class=&quot;internal alias&quot; data-slug=&quot;location-transparency&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Location Transparency&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt; (what gets looked up)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../distributed-objects&quot; class=&quot;internal alias&quot; data-slug=&quot;distributed-objects&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Distributed Objects&lt;/a&gt; (clients access objects via naming)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; RMI Registry (limited to RMI, not generalized naming)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;JNDI properties are environment-specific&lt;/strong&gt;: Different containers need different factory/URL settings&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network partition&lt;/strong&gt;: If naming service is unreachable, all lookups fail&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nickname collisions&lt;/strong&gt;: Two beans with same JNDI name cause deployment errors&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejb-roles</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-roles" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-roles.md" />
    <summary>The Problem Large enterprise software projects involve multiple stakeholders with different responsibilities.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Large enterprise software projects involve multiple stakeholders with different responsibilities. Without clear role separation, code, deployment, and operations become chaotic—developers might hardcode server paths, or deployers might not know which security settings to apply.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;EJB formalizes the software development lifecycle by dividing it into distinct roles, each with clear responsibilities. This separation of concerns ensures that code is portable, reusable, and professionally managed.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The EJB specification defines these roles:&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Role&lt;/th&gt;&lt;th&gt;Responsibility&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Bean Provider&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Writes the Java code (Bean Class, Interfaces) and business logic&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Application Assembler&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Combines multiple beans into a complete application&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;EJB Deployer&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Installs and configures the application on the server&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;System Administrator&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Monitors the live system, ensures server health&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Container/Server Provider&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Builds the application server (e.g., Oracle, IBM, JBoss)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: EJBRoles Pages: 1 --&gt;
&lt;svg width=&quot;851pt&quot; height=&quot;110pt&quot; viewBox=&quot;0.00 0.00 851.00 110.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 105.6)&quot;&gt;
&lt;title&gt;EJBRoles&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-105.6 847.08,-105.6 847.08,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- BP --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;BP&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;96.48,-101.6 0,-101.6 0,-60 96.48,-60 96.48,-101.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;48.24&quot; y=&quot;-85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bean Provider&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;48.24&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Writes Code)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- AA --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;AA&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;330.43,-101.6 184.96,-101.6 184.96,-60 330.43,-60 330.43,-101.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;257.7&quot; y=&quot;-85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Application Assembler&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;257.7&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Combines Beans)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BP&amp;#45;&amp;gt;AA --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;BP-&gt;AA&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M96.83,-80.8C119.45,-80.8 147.15,-80.8 173.11,-80.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;172.98,-84.3 182.98,-80.8 172.98,-77.3 172.98,-84.3&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;140.72&quot; y=&quot;-85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Java files&lt;/text&gt;
&lt;/g&gt;
&lt;!-- D --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;D&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;595.87,-61.6 472.57,-61.6 472.57,-20 595.87,-20 595.87,-61.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;534.22&quot; y=&quot;-45&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Deployer&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;534.22&quot; y=&quot;-28.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Installs on Server)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- AA&amp;#45;&amp;gt;D --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;AA-&gt;D&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M330.82,-70.29C370.96,-64.44 420.77,-57.18 460.93,-51.33&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;461.37,-54.81 470.76,-49.9 460.36,-47.88 461.37,-54.81&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;401.5&quot; y=&quot;-70.92&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Ejb-jar file&lt;/text&gt;
&lt;/g&gt;
&lt;!-- SA --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;SA&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;843.08,-61.6 703.81,-61.6 703.81,-20 843.08,-20 843.08,-61.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;773.45&quot; y=&quot;-45&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;System Administrator&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;773.45&quot; y=&quot;-28.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Monitors Live)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- D&amp;#45;&amp;gt;SA --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;D-&gt;SA&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M596.31,-40.8C625.53,-40.8 660.9,-40.8 692.25,-40.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;692.09,-44.3 702.09,-40.8 692.09,-37.3 692.09,-44.3&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;649.84&quot; y=&quot;-45&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Running app&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CP --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CP&lt;/title&gt;
&lt;polygon fill=&quot;lightgrey&quot; stroke=&quot;black&quot; points=&quot;319.16,-41.6 196.23,-41.6 196.23,0 319.16,0 319.16,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;257.7&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Container Provider&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;257.7&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Builds Server)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CP&amp;#45;&amp;gt;D --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CP-&gt;D&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M319.63,-23.43C358.32,-25.31 409.43,-28.19 454.57,-32 456.63,-32.17 458.73,-32.36 460.84,-32.55&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;460.48,-36.03 470.77,-33.51 461.15,-29.07 460.48,-36.03&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;401.5&quot; y=&quot;-36.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Application Server&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Bean Provider&lt;/strong&gt; only writes business logic—never server-specific code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application Assembler&lt;/strong&gt; doesn’t need to know implementation details of each bean&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deployer&lt;/strong&gt; uses vendor-specific tools but deploys standard EJB-JAR files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Portability&lt;/strong&gt;: Code written by Bean Provider runs on any EJB container&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../ejb-deployment-descriptor&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-deployment-descriptor&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Deployment Descriptor&lt;/a&gt; (used by Deployer)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; (provided by Container Provider)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;, &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt; (created by Bean Provider)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Monolithic development (no role separation)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;In small teams, one person may wear multiple roles (Bean Provider + Assembler + Deployer)&lt;/li&gt;
&lt;li&gt;Container Provider role is only for big vendors (Oracle, IBM, Red Hat)—most developers are Bean Providers&lt;/li&gt;
&lt;li&gt;Miscommunication between Assembler and Deployer causes deployment failures&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejb-verification-generation</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejb-verification-generation" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejb-verification-generation.md" />
    <summary>The Problem After deploying an EJB-JAR file, how does the container ensure your bean is valid? And who writes the EJB Object and Home Object code—you or the container? Core Idea When you deploy an EJB-JAR, the container performs two critical tasks: Verification: Checks that your bean class, interfac...</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;After deploying an EJB-JAR file, how does the container ensure your bean is valid? And who writes the EJB Object and Home Object code—you or the container?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When you deploy an EJB-JAR, the container performs two critical tasks:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Verification&lt;/strong&gt;: Checks that your bean class, interfaces, and deployment descriptor are valid (reports errors like “missing &lt;code class=&quot;notranslate&quot;&gt;ejbCreate()&lt;/code&gt; method”)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generation&lt;/strong&gt;: Automatically creates the EJB Object and Home Object implementations (plus RMI-IIOP stubs/skeletons)—you only write the interfaces, the container writes the actual classes&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Verification checks:&lt;/strong&gt;&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Bean class implements the correct interface (&lt;code class=&quot;notranslate&quot;&gt;SessionBean&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;EntityBean&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;ejbCreate()&lt;/code&gt; method exists and matches home interface’s &lt;code class=&quot;notranslate&quot;&gt;create()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Deployment descriptor is well-formed XML&lt;/li&gt;
&lt;li&gt;All required exceptions are declared&lt;/li&gt;
&lt;/ul&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Generation outputs:&lt;/strong&gt;&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;EJB Object class (implements your Remote Interface)&lt;/li&gt;
&lt;li&gt;Home Object class (implements your Home Interface)&lt;/li&gt;
&lt;li&gt;RMI-IIOP stubs (for remote clients) and skeletons&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: VerificationGeneration Pages: 1 --&gt;
&lt;svg width=&quot;468pt&quot; height=&quot;281pt&quot; viewBox=&quot;0.00 0.00 468.00 281.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 277)&quot;&gt;
&lt;title&gt;VerificationGeneration&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-277 464.31,-277 464.31,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_input&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-8 8,-265 136.78,-265 136.78,-8 8,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-248.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Input (Your Code)&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_output&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;327.72,-8 327.72,-211 452.95,-211 452.95,-8 327.72,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;390.34&quot; y=&quot;-194.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Output (Generated)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;111.69,-57.8 33.09,-57.8 33.09,-16.2 111.69,-16.2 111.69,-57.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bean Class&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-24.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(.class)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Container&lt;/title&gt;
&lt;path fill=&quot;lightgrey&quot; stroke=&quot;black&quot; d=&quot;M299.72,-120.4C299.72,-123.27 269.48,-125.6 232.25,-125.6 195.02,-125.6 164.78,-123.27 164.78,-120.4 164.78,-120.4 164.78,-73.6 164.78,-73.6 164.78,-70.73 195.02,-68.4 232.25,-68.4 269.48,-68.4 299.72,-70.73 299.72,-73.6 299.72,-73.6 299.72,-120.4 299.72,-120.4&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M299.72,-120.4C299.72,-117.53 269.48,-115.2 232.25,-115.2 195.02,-115.2 164.78,-117.53 164.78,-120.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;232.25&quot; y=&quot;-101.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Container&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;232.25&quot; y=&quot;-84.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Verifies &amp;#x26; Generates&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;Container --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M112.01,-51.68C124.71,-56.51 139.32,-62.06 153.87,-67.59&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;152.41,-70.78 163,-71.06 154.9,-64.24 152.41,-70.78&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Remote --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Remote&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;128.78,-117.8 16,-117.8 16,-76.2 128.78,-76.2 128.78,-117.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-101.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Remote Interface&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-84.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(.class)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Remote&amp;#45;&amp;gt;Container --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Remote-&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M129.04,-97C136.83,-97 144.94,-97 153.05,-97&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;152.95,-100.5 162.95,-97 152.95,-93.5 152.95,-100.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Home --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Home&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;124.11,-177.8 20.67,-177.8 20.67,-136.2 124.11,-136.2 124.11,-177.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-161.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Home Interface&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-144.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(.class)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home&amp;#45;&amp;gt;Container --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Home-&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M124.21,-137.69C133.7,-134.07 143.83,-130.23 153.92,-126.39&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;154.87,-129.77 162.98,-122.95 152.39,-123.23 154.87,-129.77&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- XML --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;XML&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;111.29,-232 33.48,-232 33.48,-196 111.29,-196 111.29,-232&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.39&quot; y=&quot;-209.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejb-jar.xml&lt;/text&gt;
&lt;/g&gt;
&lt;!-- XML&amp;#45;&amp;gt;Container --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;XML-&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M111.74,-200.28C120.28,-196.52 129.08,-192.06 136.78,-187 159.42,-172.1 181.54,-151.46 198.68,-133.71&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;200.81,-136.55 205.14,-126.88 195.72,-131.74 200.81,-136.55&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- EJBObj --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJBObj&lt;/title&gt;
&lt;polygon fill=&quot;yellow&quot; stroke=&quot;black&quot; points=&quot;431.26,-57.8 348.42,-57.8 348.42,-16.2 431.26,-16.2 431.26,-57.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;389.84&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;389.84&quot; y=&quot;-24.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Generated)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container&amp;#45;&amp;gt;EJBObj --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container-&gt;EJBObj&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M300.14,-71.21C312.62,-66.39 325.49,-61.43 337.42,-56.83&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;338.59,-60.13 346.66,-53.26 336.07,-53.6 338.59,-60.13&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- HomeObj --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;HomeObj&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;435.35,-117.8 344.32,-117.8 344.32,-76.2 435.35,-76.2 435.35,-117.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;389.84&quot; y=&quot;-101.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Home Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;389.84&quot; y=&quot;-84.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Generated)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container&amp;#45;&amp;gt;HomeObj --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container-&gt;HomeObj&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M300.14,-97C311.02,-97 322.2,-97 332.79,-97&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;332.5,-100.5 342.5,-97 332.5,-93.5 332.5,-100.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Stubs --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Stubs&lt;/title&gt;
&lt;polygon fill=&quot;orange&quot; stroke=&quot;black&quot; points=&quot;444.31,-177.8 335.36,-177.8 335.36,-136.2 444.31,-136.2 444.31,-177.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;389.84&quot; y=&quot;-161.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;RMI-IIOP Stubs&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;389.84&quot; y=&quot;-144.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Generated)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container&amp;#45;&amp;gt;Stubs --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container-&gt;Stubs&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M300.14,-122.79C308.27,-125.93 316.56,-129.13 324.65,-132.25&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;323.14,-135.42 333.73,-135.75 325.66,-128.89 323.14,-135.42&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;You never write EJB Object or Home Object code&lt;/strong&gt;: Container generates them from your interfaces&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verification prevents runtime errors&lt;/strong&gt;: Catch missing methods before the bean is used&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor-specific generation&lt;/strong&gt;: Each container has its own tools (sometimes proprietary)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Intelligent error reporting&lt;/strong&gt;: Commercial tools tell you exactly what’s wrong&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt;, &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt;, &lt;a href=&quot;../../ejb-deployment-descriptor&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-deployment-descriptor&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Deployment Descriptor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../ejb-object&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-object&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Object&lt;/a&gt;, &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Object&lt;/a&gt; (generated)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ejb-development-lifecycle&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-development-lifecycle&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Development Lifecycle&lt;/a&gt; (step 5: deploy triggers this)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Regular Java (no verification, no generation—you write everything)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Generated classes are container-specific&lt;/strong&gt;: You can’t take JBoss-generated stubs and use them on WebLogic&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verification happens at deployment, not compile time&lt;/strong&gt;: Your code compiles fine, but deployment fails&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Some containers generate lazily&lt;/strong&gt;: EJB Object might be generated on first client lookup, not at deployment&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejbactivate</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejbactivate" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejbactivate.md" />
    <summary>The Problem When a passivated stateful session bean is needed again, the container must restore its state from secondary storage back into memory.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When a passivated stateful session bean is needed again, the container must restore its state from secondary storage back into memory. The bean needs to know when this happens to reinitialize any non-serializable resources (like database connections, JMS connections).&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;code class=&quot;notranslate&quot;&gt;ejbActivate()&lt;/code&gt; is a callback method that the EJB container calls on a stateful session bean AFTER it has been passivated and is now being restored to the ready state. It’s the counterpart to &lt;code class=&quot;notranslate&quot;&gt;ejbPassivate()&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Container decides&lt;/strong&gt; — based on client request, container selects a passivated bean&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deserialization&lt;/strong&gt; — container reads bean state from storage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ejbActivate() called&lt;/strong&gt; — container calls this method AFTER state is restored&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bean reinitializes&lt;/strong&gt; — open resources, reconnect to services that weren’t serialized&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;For entity beans, &lt;code class=&quot;notranslate&quot;&gt;ejbActivate()&lt;/code&gt; is called when an entity bean is moved from the pool to the ready state (associated with a specific primary key).&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;602pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 602.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 598.17,-94 598.17,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Passivated State --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Passivated State&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M94.6,-36C94.6,-36 12,-36 12,-36 6,-36 0,-30 0,-24 0,-24 0,-12 0,-12 0,-6 6,0 12,0 12,0 94.6,0 94.6,0 100.6,0 106.6,-6 106.6,-12 106.6,-12 106.6,-24 106.6,-24 106.6,-30 100.6,-36 94.6,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;53.3&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Passivated State&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container: need bean --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Container: need bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M265.55,-36C265.55,-36 154.6,-36 154.6,-36 148.6,-36 142.6,-30 142.6,-24 142.6,-24 142.6,-12 142.6,-12 142.6,-6 148.6,0 154.6,0 154.6,0 265.55,0 265.55,0 271.55,0 277.55,-6 277.55,-12 277.55,-12 277.55,-24 277.55,-24 277.55,-30 271.55,-36 265.55,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;210.07&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Container: need bean&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Passivated State&amp;#45;&amp;gt;Container: need bean --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Passivated State-&gt;Container: need bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M106.7,-18C114.45,-18 122.57,-18 130.71,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;130.67,-21.5 140.67,-18 130.67,-14.5 130.67,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Deserialize --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Deserialize&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M399.95,-36C399.95,-36 344.99,-36 344.99,-36 338.99,-36 332.99,-30 332.99,-24 332.99,-24 332.99,-12 332.99,-12 332.99,-6 338.99,0 344.99,0 344.99,0 399.95,0 399.95,0 405.95,0 411.95,-6 411.95,-12 411.95,-12 411.95,-24 411.95,-24 411.95,-30 405.95,-36 399.95,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;372.47&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Deserialize&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container: need bean&amp;#45;&amp;gt;Deserialize --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container: need bean-&gt;Deserialize&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M277.7,-18C292.36,-18 307.65,-18 321.51,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;321.27,-21.5 331.27,-18 321.27,-14.5 321.27,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- ejbActivate() called --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ejbActivate() called&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M582.17,-36C582.17,-36 479.4,-36 479.4,-36 473.4,-36 467.4,-30 467.4,-24 467.4,-24 467.4,-12 467.4,-12 467.4,-6 473.4,0 479.4,0 479.4,0 582.17,0 582.17,0 588.17,0 594.17,-6 594.17,-12 594.17,-12 594.17,-24 594.17,-24 594.17,-30 588.17,-36 582.17,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;530.78&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbActivate() called&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Deserialize&amp;#45;&amp;gt;ejbActivate() called --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Deserialize-&gt;ejbActivate() called&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M412.11,-18C425.3,-18 440.51,-18 455.54,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;455.44,-21.5 465.44,-18 455.44,-14.5 455.44,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- ejbActivate() --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ejbActivate()&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M86.22,-90C86.22,-90 20.37,-90 20.37,-90 14.37,-90 8.37,-84 8.37,-78 8.37,-78 8.37,-66 8.37,-66 8.37,-60 14.37,-54 20.37,-54 20.37,-54 86.22,-54 86.22,-54 92.22,-54 98.22,-60 98.22,-66 98.22,-66 98.22,-78 98.22,-78 98.22,-84 92.22,-90 86.22,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;53.3&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbActivate()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Ready State --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Ready State&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M239.7,-90C239.7,-90 180.44,-90 180.44,-90 174.44,-90 168.44,-84 168.44,-78 168.44,-78 168.44,-66 168.44,-66 168.44,-60 174.44,-54 180.44,-54 180.44,-54 239.7,-54 239.7,-54 245.7,-54 251.7,-60 251.7,-66 251.7,-66 251.7,-78 251.7,-78 251.7,-84 245.7,-90 239.7,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;210.07&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Ready State&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ejbActivate()&amp;#45;&amp;gt;Ready State --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;ejbActivate()-&gt;Ready State&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M98.65,-72C116.77,-72 137.87,-72 156.74,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;156.65,-75.5 166.65,-72 156.65,-68.5 156.65,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Bean serves client --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean serves client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M419.4,-90C419.4,-90 325.55,-90 325.55,-90 319.55,-90 313.55,-84 313.55,-78 313.55,-78 313.55,-66 313.55,-66 313.55,-60 319.55,-54 325.55,-54 325.55,-54 419.4,-54 419.4,-54 425.4,-54 431.4,-60 431.4,-66 431.4,-66 431.4,-78 431.4,-78 431.4,-84 425.4,-90 419.4,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;372.47&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bean serves client&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Ready State&amp;#45;&amp;gt;Bean serves client --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Ready State-&gt;Bean serves client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M251.96,-72C267.19,-72 284.93,-72 302.01,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;301.59,-75.5 311.59,-72 301.59,-68.5 301.59,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Callback method&lt;/strong&gt; — container calls it, not the client&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stateful SB&lt;/strong&gt; — reinitialize transient resources after passivation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Entity Bean&lt;/strong&gt; — called when bean moves from pool to ready (associated with PK)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No parameters&lt;/strong&gt; — container doesn’t pass any arguments&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../passivation&quot; class=&quot;internal alias&quot; data-slug=&quot;passivation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Passivation&lt;/a&gt; — ejbActivate is the reverse process&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../activation&quot; class=&quot;internal alias&quot; data-slug=&quot;activation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Activation&lt;/a&gt; — the overall process this method participates in&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../ejbpassivate&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbpassivate&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbPassivate()&lt;/a&gt; — called before passivation&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../stateful-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateful-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateful Session Bean&lt;/a&gt; — primary user of this callback&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt; — also uses this callback in lifecycle&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Only for stateful session beans and entity beans (NOT stateless)&lt;/li&gt;
&lt;li&gt;Don’t do business logic here — just resource reinitialization&lt;/li&gt;
&lt;li&gt;If this method throws an exception, the bean may be discarded&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>ejbpassivate</title>
    <link href="https://animishraa05.github.io/wiki/ejb/ejbpassivate" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/ejbpassivate.md" />
    <summary>The Problem When a stateful session bean is idle (no client activity for a while), the container may want to free up memory by serializing the bean to secondary storage.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When a stateful session bean is idle (no client activity for a while), the container may want to free up memory by serializing the bean to secondary storage. Before serialization, the bean needs to release any non-serializable resources (like open database connections, network sockets).&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;code class=&quot;notranslate&quot;&gt;ejbPassivate()&lt;/code&gt; is a callback method that the EJB container calls on a stateful session bean BEFORE it is passivated (serialized to storage). It allows the bean to release resources that cannot be serialized.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Container decides&lt;/strong&gt; — bean is idle, container chooses to passivate it&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ejbPassivate() called&lt;/strong&gt; — BEFORE serialization, container calls this method&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bean releases resources&lt;/strong&gt; — close DB connections, JMS connections, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Serialization&lt;/strong&gt; — container serializes bean to secondary storage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory freed&lt;/strong&gt; — bean instance returned to pool or garbage collected&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;When the client needs the bean again, &lt;code class=&quot;notranslate&quot;&gt;ejbActivate()&lt;/code&gt; will be called to restore resources.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;594pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 594.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 590.44,-94 590.44,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Ready State --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Ready State&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M76.9,-36C76.9,-36 17.64,-36 17.64,-36 11.64,-36 5.64,-30 5.64,-24 5.64,-24 5.64,-12 5.64,-12 5.64,-6 11.64,0 17.64,0 17.64,0 76.9,0 76.9,0 82.9,0 88.9,-6 88.9,-12 88.9,-12 88.9,-24 88.9,-24 88.9,-30 82.9,-36 76.9,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;47.27&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Ready State&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container: idle timeout --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Container: idle timeout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M264.39,-36C264.39,-36 142.53,-36 142.53,-36 136.53,-36 130.53,-30 130.53,-24 130.53,-24 130.53,-12 130.53,-12 130.53,-6 136.53,0 142.53,0 142.53,0 264.39,0 264.39,0 270.39,0 276.39,-6 276.39,-12 276.39,-12 276.39,-24 276.39,-24 276.39,-30 270.39,-36 264.39,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;203.46&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Container: idle timeout&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Ready State&amp;#45;&amp;gt;Container: idle timeout --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Ready State-&gt;Container: idle timeout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M89.18,-18C98.42,-18 108.56,-18 118.85,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;118.53,-21.5 128.53,-18 118.53,-14.5 118.53,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- ejbPassivate() called --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ejbPassivate() called&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M431.85,-36C431.85,-36 324.39,-36 324.39,-36 318.39,-36 312.39,-30 312.39,-24 312.39,-24 312.39,-12 312.39,-12 312.39,-6 318.39,0 324.39,0 324.39,0 431.85,0 431.85,0 437.85,0 443.85,-6 443.85,-12 443.85,-12 443.85,-24 443.85,-24 443.85,-30 437.85,-36 431.85,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;378.12&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbPassivate() called&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container: idle timeout&amp;#45;&amp;gt;ejbPassivate() called --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container: idle timeout-&gt;ejbPassivate() called&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M276.68,-18C284.66,-18 292.8,-18 300.83,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;300.55,-21.5 310.55,-18 300.55,-14.5 300.55,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- ejbPassivate() --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ejbPassivate()&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M82.53,-90C82.53,-90 12,-90 12,-90 6,-90 0,-84 0,-78 0,-78 0,-66 0,-66 0,-60 6,-54 12,-54 12,-54 82.53,-54 82.53,-54 88.53,-54 94.53,-60 94.53,-66 94.53,-66 94.53,-78 94.53,-78 94.53,-84 88.53,-90 82.53,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;47.27&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ejbPassivate()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Release resources --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Release resources&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M249.41,-90C249.41,-90 157.52,-90 157.52,-90 151.52,-90 145.52,-84 145.52,-78 145.52,-78 145.52,-66 145.52,-66 145.52,-60 151.52,-54 157.52,-54 157.52,-54 249.41,-54 249.41,-54 255.41,-54 261.41,-60 261.41,-66 261.41,-66 261.41,-78 261.41,-78 261.41,-84 255.41,-90 249.41,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;203.46&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Release resources&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ejbPassivate()&amp;#45;&amp;gt;Release resources --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;ejbPassivate()-&gt;Release resources&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M94.95,-72C107.15,-72 120.57,-72 133.66,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;133.53,-75.5 143.53,-72 133.53,-68.5 133.53,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Serialize to storage --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Serialize to storage&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M427.76,-90C427.76,-90 328.47,-90 328.47,-90 322.47,-90 316.47,-84 316.47,-78 316.47,-78 316.47,-66 316.47,-66 316.47,-60 322.47,-54 328.47,-54 328.47,-54 427.76,-54 427.76,-54 433.76,-54 439.76,-60 439.76,-66 439.76,-66 439.76,-78 439.76,-78 439.76,-84 433.76,-90 427.76,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;378.12&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Serialize to storage&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Release resources&amp;#45;&amp;gt;Serialize to storage --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Release resources-&gt;Serialize to storage&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M261.48,-72C275.27,-72 290.2,-72 304.6,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;304.5,-75.5 314.5,-72 304.5,-68.5 304.5,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Passivated State --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Passivated State&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M574.44,-90C574.44,-90 491.85,-90 491.85,-90 485.85,-90 479.85,-84 479.85,-78 479.85,-78 479.85,-66 479.85,-66 479.85,-60 485.85,-54 491.85,-54 491.85,-54 574.44,-54 574.44,-54 580.44,-54 586.44,-60 586.44,-66 586.44,-66 586.44,-78 586.44,-78 586.44,-84 580.44,-90 574.44,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;533.14&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Passivated State&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Serialize to storage&amp;#45;&amp;gt;Passivated State --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Serialize to storage-&gt;Passivated State&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M440.04,-72C449.4,-72 459.09,-72 468.51,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;468.31,-75.5 478.31,-72 468.31,-68.5 468.31,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Callback method&lt;/strong&gt; — container calls it, not the client&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Release non-serializable resources&lt;/strong&gt; — main purpose&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stateful SB only&lt;/strong&gt; — stateless beans don’t have passivation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No parameters&lt;/strong&gt; — container doesn’t pass any arguments&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../passivation&quot; class=&quot;internal alias&quot; data-slug=&quot;passivation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Passivation&lt;/a&gt; — ejbPassivate is part of this process&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../ejbactivate&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbactivate&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbActivate()&lt;/a&gt; — called after activation (reverse)&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../stateful-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateful-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateful Session Bean&lt;/a&gt; — primary user of this callback&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../activation&quot; class=&quot;internal alias&quot; data-slug=&quot;activation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Activation&lt;/a&gt; — the overall lifecycle process&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../instance-pooling&quot; class=&quot;internal alias&quot; data-slug=&quot;instance-pooling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Instance Pooling&lt;/a&gt; — passivated beans free up pool slots&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Only for stateful session beans (NOT stateless, NOT entity beans)&lt;/li&gt;
&lt;li&gt;Don’t do business logic here — just cleanup&lt;/li&gt;
&lt;li&gt;If this method throws an exception, passivation fails and bean stays in memory&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>entity-bean-identity</title>
    <link href="https://animishraa05.github.io/wiki/ejb/entity-bean-identity" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/entity-bean-identity.md" />
    <summary>The Problem Session beans are all equivalent (especially stateless)—there’s no way to distinguish one from another.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="entity-bean" label="entity-bean" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Session beans are all equivalent (especially stateless)—there’s no way to distinguish one from another. But entity beans represent specific data records (like a specific bank account). How do you identify which entity bean instance represents which record?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Entity beans have an &lt;strong&gt;identity&lt;/strong&gt;—a primary key that uniquely distinguishes each instance. This allows:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Comparing two entity beans (“Are they the same account?”)&lt;/li&gt;
&lt;li&gt;Clients referring to specific entities by their primary key&lt;/li&gt;
&lt;li&gt;Sharing entities across multiple clients (unlike session beans which are client-dedicated)&lt;/li&gt;
&lt;/ul&gt;
&lt;p dir=&quot;auto&quot;&gt;The identity is typically the primary key of the database row the entity represents.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Define primary key class&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;AccountPK&lt;/code&gt; with fields matching the table’s primary key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code class=&quot;notranslate&quot;&gt;getPrimaryKey()&lt;/code&gt; method&lt;/strong&gt;: Entity beans implement this to return their primary key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Finder methods&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;ejbFindByPrimaryKey(PK)&lt;/code&gt; locates the correct database record&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client reference&lt;/strong&gt;: Client can pass primary keys to other clients, enabling shared access&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: Identity Pages: 1 --&gt;
&lt;svg width=&quot;410pt&quot; height=&quot;256pt&quot; viewBox=&quot;0.00 0.00 410.00 256.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 251.8)&quot;&gt;
&lt;title&gt;Identity&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-251.8 405.58,-251.8 405.58,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_entities&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;256.02,-13.8 256.02,-239.8 393.58,-239.8 393.58,-13.8 256.02,-13.8&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- E1 --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;E1&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;378.19,-80 271.42,-80 271.42,-21.6 378.19,-21.6 378.19,-80&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-63.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Entity Bean A&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-46.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;PK = 1&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Ray&#039;s Account)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- E2 --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;E2&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;378.58,-156 271.02,-156 271.02,-97.6 378.58,-97.6 378.58,-156&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-139.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Entity Bean B&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-122.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;PK = 2&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-105.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Bob&#039;s Account)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- E3 --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;E3&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;385.58,-232 264.02,-232 264.02,-173.6 385.58,-173.6 385.58,-232&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-215.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Entity Bean C&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-198.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;PK = 3&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;324.8&quot; y=&quot;-181.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Monty&#039;s Account)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client1 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client1&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;113.15,-101.6 13.03,-101.6 13.03,-60 113.15,-60 113.15,-101.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;63.09&quot; y=&quot;-85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client 1&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;63.09&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Asks for PK=1&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client1&amp;#45;&amp;gt;E1 --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client1-&gt;E1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M113.55,-75.09C154.98,-70.3 214.41,-63.44 259.52,-58.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;259.92,-61.7 269.45,-57.08 259.12,-54.75 259.92,-61.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;195.1&quot; y=&quot;-92.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Both clients can&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;195.1&quot; y=&quot;-75.3&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;share same entity!&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client2 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client2&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;126.17,-41.6 0,-41.6 0,0 126.17,0 126.17,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;63.09&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client 2&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;63.09&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Also asks for PK=1&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client2&amp;#45;&amp;gt;E1 --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client2-&gt;E1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M126.63,-28.02C166.88,-32.67 219.05,-38.7 259.62,-43.39&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;259.17,-46.86 269.5,-44.53 259.97,-39.9 259.17,-46.86&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Primary key = identity&lt;/strong&gt;: Two entity beans with same PK represent the same data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared across clients&lt;/strong&gt;: Unlike session beans, multiple clients can use the same entity&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Not just for databases&lt;/strong&gt;: Identity concept applies even if using object databases&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code class=&quot;notranslate&quot;&gt;getPrimaryKey()&lt;/code&gt; in BMP&lt;/strong&gt;: Bean uses PK to know which record to load/store in &lt;code class=&quot;notranslate&quot;&gt;ejbLoad()&lt;/code&gt;/&lt;code class=&quot;notranslate&quot;&gt;ejbStore()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt;, &lt;a href=&quot;../../primary-key-class&quot; class=&quot;internal alias&quot; data-slug=&quot;primary-key-class&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Primary Key Class&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../finder-methods&quot; class=&quot;internal alias&quot; data-slug=&quot;finder-methods&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Finder Methods&lt;/a&gt; (locate entities by identity)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ejbcreate&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbcreate&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbCreate()&lt;/a&gt;, &lt;a href=&quot;../../ejbload&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbload&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbLoad()&lt;/a&gt;, &lt;a href=&quot;../../ejbstore&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbstore&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbStore()&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt; (no identity—anonymous workers)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Composite primary keys&lt;/strong&gt;: Sometimes PK has multiple fields—need a custom &lt;code class=&quot;notranslate&quot;&gt;PK&lt;/code&gt; class&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Identity crisis in pool&lt;/strong&gt;: Pooled entity beans can represent different records at different times (container swaps the data)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code class=&quot;notranslate&quot;&gt;getPrimaryKey()&lt;/code&gt; not for clients&lt;/strong&gt;: It’s for BMP beans to know which record to access&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>entity-bean-instance-vs-data</title>
    <link href="https://animishraa05.github.io/wiki/ejb/entity-bean-instance-vs-data" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/entity-bean-instance-vs-data.md" />
    <summary>The Problem The term “Entity Bean” is used loosely—sometimes it means the in-memory Java object, sometimes it means the database record.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="entity-bean" label="entity-bean" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The term “Entity Bean” is used loosely—sometimes it means the in-memory Java object, sometimes it means the database record. This confusion makes discussions about entity beans unclear. What’s the difference?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The EJB spec clarifies two distinct concepts:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Entity Bean Instance&lt;/strong&gt;: The in-memory Java object (an instance of your entity bean class). It’s the “view” into the database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Entity Bean Data&lt;/strong&gt;: The actual persistent data stored in the database (the record/row).&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The instance loads data from the database (in &lt;code class=&quot;notranslate&quot;&gt;ejbLoad()&lt;/code&gt;), modifies it in memory, and saves it back (in &lt;code class=&quot;notranslate&quot;&gt;ejbStore()&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;Database Record (Entity Bean Data)
    ↓ ejbLoad()
In-Memory Object (Entity Bean Instance)
    ↓ business methods modify fields
In-Memory Object (with changes)
    ↓ ejbStore()
Database Record (updated)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: InstanceVsData Pages: 1 --&gt;
&lt;svg width=&quot;267pt&quot; height=&quot;318pt&quot; viewBox=&quot;0.00 0.00 267.00 318.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 314)&quot;&gt;
&lt;title&gt;InstanceVsData&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-314 262.7,-314 262.7,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Data --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Data&lt;/title&gt;
&lt;path fill=&quot;lightyellow&quot; stroke=&quot;black&quot; d=&quot;M202.43,-300.6C202.43,-305.79 169.68,-310 129.35,-310 89.03,-310 56.27,-305.79 56.27,-300.6 56.27,-300.6 56.27,-216 56.27,-216 56.27,-210.81 89.03,-206.6 129.35,-206.6 169.68,-206.6 202.43,-210.81 202.43,-216 202.43,-216 202.43,-300.6 202.43,-300.6&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M202.43,-300.6C202.43,-295.41 169.68,-291.2 129.35,-291.2 89.03,-291.2 56.27,-295.41 56.27,-300.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-279.3&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Entity Bean Data&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-262.5&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Database Row)&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-245.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;| ID | Owner | Balance |&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-228.9&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;| 1 | Ray | 1000 |&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Instance --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Instance&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;258.7,-137 0,-137 0,-78.6 258.7,-78.6 258.7,-137&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-120.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Entity Bean Instance&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-103.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(In-Memory Java Object)&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;accountID=1, owner=&quot;Ray&quot;, balance=1000&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Data&amp;#45;&amp;gt;Instance --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Data-&gt;Instance&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M86.22,-206.79C82.87,-200.93 79.99,-194.82 77.92,-188.6 73.21,-174.43 71.84,-168.64 77.92,-155 79.28,-151.97 80.94,-149.05 82.82,-146.26&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;85.54,-148.46 89.04,-138.46 80.07,-144.1 85.54,-148.46&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;119.14&quot; y=&quot;-176&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. ejbLoad()&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;119.14&quot; y=&quot;-159.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Read from DB&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Instance&amp;#45;&amp;gt;Data --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Instance-&gt;Data&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M152.16,-137.29C155.54,-142.88 158.5,-148.9 160.35,-155 164.32,-168.04 163.46,-182.01 160.22,-195.32&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;156.88,-194.26 157.41,-204.85 163.59,-196.24 156.88,-194.26&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;197.99&quot; y=&quot;-176&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. ejbStore()&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;197.99&quot; y=&quot;-159.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Write to DB&lt;/text&gt;
&lt;/g&gt;
&lt;!-- note --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;note&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;199.24,-41.6 53.46,-41.6 53.46,0 205.24,0 205.24,-35.6 199.24,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;199.24,-41.6 199.24,-35.6&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;205.24,-35.6 199.24,-35.6&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client modifies balance&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;129.35&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Instance.balance = 2000&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Instance&amp;#45;&amp;gt;note --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Instance-&gt;note&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M129.35,-78.5C129.35,-70.45 129.35,-61.64 129.35,-53.41&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;132.85,-53.44 129.35,-43.44 125.85,-53.44 132.85,-53.44&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Instance is temporary&lt;/strong&gt;: Created when needed, may be pooled/reused for different data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data is permanent&lt;/strong&gt;: Survives server crashes, lives in database&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One-to-one mapping&lt;/strong&gt;: At any moment, one instance represents one data record&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container manages sync&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;ejbLoad()&lt;/code&gt; and &lt;code class=&quot;notranslate&quot;&gt;ejbStore()&lt;/code&gt; keep instance and data in sync&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt;, &lt;a href=&quot;../../ejbload&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbload&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbLoad()&lt;/a&gt;, &lt;a href=&quot;../../ejbstore&quot; class=&quot;internal alias&quot; data-slug=&quot;ejbstore&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ejbStore()&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../bean-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;bean-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;BMP&lt;/a&gt;, &lt;a href=&quot;../../container-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;container-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CMP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../persistence-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;persistence-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Persistence Concepts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Session beans (no persistent data, only in-memory instances)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Stale data&lt;/strong&gt;: If another client modifies the DB directly, in-memory instance has old data (until next &lt;code class=&quot;notranslate&quot;&gt;ejbLoad()&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Instance pooling&lt;/strong&gt;: The same Java instance might represent Ray’s account now, Bob’s account later (container reuses instances)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transparent to client&lt;/strong&gt;: Client doesn’t know or care about instance vs data distinction—they just call methods&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>explicit-vs-implicit-middleware</title>
    <link href="https://animishraa05.github.io/wiki/ejb/explicit-vs-implicit-middleware" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/explicit-vs-implicit-middleware.md" />
    <summary>The Problem Distributed applications need middleware services: security, transactions, threading, network communication.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="middleware" label="middleware" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Distributed applications need middleware services: security, transactions, threading, network communication. Who should write this code—the application developer or the infrastructure?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Explicit Middleware&lt;/strong&gt;: Developer manually writes code for networking, security, threading. You control everything but spend 80% of your time on infrastructure.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implicit Middleware&lt;/strong&gt;: The EJB container automatically handles middleware services. Developer writes only business logic; the server manages security, transactions, and networking behind the scenes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;






























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Aspect&lt;/th&gt;&lt;th&gt;Explicit Middleware&lt;/th&gt;&lt;th&gt;Implicit Middleware (EJB)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Networking&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Developer writes socket/RMI code&lt;/td&gt;&lt;td&gt;Container generates stubs/skeletons&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Developer checks permissions in code&lt;/td&gt;&lt;td&gt;Container intercepts and checks roles&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Transactions&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Developer begins/commits transactions&lt;/td&gt;&lt;td&gt;Container manages via deployment descriptor&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Threading&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Developer manages thread pools&lt;/td&gt;&lt;td&gt;Container manages bean pooling&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: MiddlewareComparison Pages: 1 --&gt;
&lt;svg width=&quot;372pt&quot; height=&quot;323pt&quot; viewBox=&quot;0.00 0.00 372.00 323.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 319.2)&quot;&gt;
&lt;title&gt;MiddlewareComparison&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-319.2 368,-319.2 368,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_explicit&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-108 8,-307.2 180,-307.2 180,-108 8,-108&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;94&quot; y=&quot;-290.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Explicit Middleware&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_implicit&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;188,-8 188,-298.8 356,-298.8 356,-8 188,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272&quot; y=&quot;-282.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Implicit Middleware (EJB)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ED --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ED&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;172.44,-274.4 15.56,-274.4 15.56,-216 172.44,-216 172.44,-274.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;94&quot; y=&quot;-257.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Developer Code&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;94&quot; y=&quot;-241&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Security + Network +&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;94&quot; y=&quot;-224.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Transactions + Business)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- S1 --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S1&lt;/title&gt;
&lt;polygon fill=&quot;lightgrey&quot; stroke=&quot;black&quot; points=&quot;121,-152 67,-152 67,-116 121,-116 121,-152&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;94&quot; y=&quot;-129.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ED&amp;#45;&amp;gt;S1 --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;ED-&gt;S1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M94,-215.51C94,-199.5 94,-179.61 94,-163.61&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;97.5,-163.78 94,-153.78 90.5,-163.78 97.5,-163.78&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;131.91&quot; y=&quot;-185.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Manual setup&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BC --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;BC&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;343.38,-266 200.62,-266 200.62,-224.4 343.38,-224.4 343.38,-266&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272&quot; y=&quot;-249.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bean Provider Code&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272&quot; y=&quot;-232.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Only Business Logic)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;C&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;347.33,-163.2 196.67,-163.2 196.67,-104.8 347.33,-104.8 347.33,-163.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272&quot; y=&quot;-146.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Container&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272&quot; y=&quot;-129.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Security + Network +&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272&quot; y=&quot;-113&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Transactions + Pooling)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BC&amp;#45;&amp;gt;C --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;BC-&gt;C&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M272,-223.92C272,-210.08 272,-191.31 272,-174.58&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;275.5,-174.92 272,-164.92 268.5,-174.92 275.5,-174.92&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- S2 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;S2&lt;/title&gt;
&lt;polygon fill=&quot;lightgrey&quot; stroke=&quot;black&quot; points=&quot;299,-52 245,-52 245,-16 299,-16 299,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;272&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C&amp;#45;&amp;gt;S2 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;C-&gt;S2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M272,-104.39C272,-91.63 272,-76.63 272,-63.84&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;275.5,-63.92 272,-53.92 268.5,-63.92 275.5,-63.92&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;301.55&quot; y=&quot;-74.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Automatic&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Implicit middleware = Productivity&lt;/strong&gt;: Developer focuses on business value, not infrastructure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EJB Container is the implicit middleware provider&lt;/strong&gt;: It intercepts calls and adds services&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Declarative approach&lt;/strong&gt;: In EJB, you declare requirements in &lt;code class=&quot;notranslate&quot;&gt;ejb-jar.xml&lt;/code&gt;—container implements them&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor-specific&lt;/strong&gt;: Each container provider (JBoss, WebLogic) implements the implicit middleware differently&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt;, &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Transactions&lt;/a&gt;, &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; (both provided implicitly)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../rmi-remote-method-invocation&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-remote-method-invocation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI&lt;/a&gt; (explicit—you write all networking code)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../declarative-vs-programmatic-transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;declarative-vs-programmatic-transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CMT vs BMT&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Debugging is harder with implicit middleware&lt;/strong&gt;: When something fails, is it your code or the container?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Less control&lt;/strong&gt;: You can’t fine-tune threading or connection pools—container decides&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor lock-in&lt;/strong&gt;: Implicit middleware behavior varies across vendors (though standard APIs stay same)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>j2ee-compliance</title>
    <link href="https://animishraa05.github.io/wiki/ejb/j2ee-compliance" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/j2ee-compliance.md" />
    <summary>The Problem How do customers know if a vendor’s application server truly implements all J2EE APIs correctly? Vendors might claim compliance but cut corners or implement APIs incorrectly.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="j2ee" label="j2ee" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;How do customers know if a vendor’s application server truly implements all J2EE APIs correctly? Vendors might claim compliance but cut corners or implement APIs incorrectly. We need a standardized way to verify and certify implementations.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE compliance is achieved when a vendor’s product passes the Test Compatibility Kit (TCK) provided by Sun. Compliant products earn the “J2EE-compliant” brand, assuring customers that the product correctly implements the specification.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Sun provides three things: Specifications (PDFs), TCK (test suite), and RI (reference implementation)&lt;/li&gt;
&lt;li&gt;Vendor implements all J2EE APIs (EJB, JMS, JDBC, etc.)&lt;/li&gt;
&lt;li&gt;Vendor runs TCK tests against their implementation&lt;/li&gt;
&lt;li&gt;If all tests pass, Sun issues J2EE compliance certification&lt;/li&gt;
&lt;li&gt;Customers can check reviews (e.g., TheServerSide.com) to compare compliant products&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Compliance encourages competition while ensuring code portability.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;891pt&quot; height=&quot;178pt&quot; viewBox=&quot;0.00 0.00 891.00 178.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 174)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-174 886.84,-174 886.84,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Sun Microsystems --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Sun Microsystems&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M292.73,-114.17C292.73,-114.17 199.55,-99.83 199.55,-99.83 193.62,-98.91 193.62,-97.09 199.55,-96.17 199.55,-96.17 292.73,-81.83 292.73,-81.83 298.66,-80.91 310.52,-80.91 316.45,-81.83 316.45,-81.83 409.63,-96.17 409.63,-96.17 415.56,-97.09 415.56,-98.91 409.63,-99.83 409.63,-99.83 316.45,-114.17 316.45,-114.17 310.52,-115.09 298.66,-115.09 292.73,-114.17&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;304.59&quot; y=&quot;-93.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Sun Microsystems&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Spec --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2EE Spec&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;593.85,-116 523.58,-116 523.58,-80 599.85,-80 599.85,-110 593.85,-116&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;593.85,-116 593.85,-110&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;599.85,-110 593.85,-110&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;561.72&quot; y=&quot;-93.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2EE Spec&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Sun Microsystems&amp;#45;&amp;gt;J2EE Spec --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Sun Microsystems-&gt;J2EE Spec&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M424.56,-98C455.4,-98 486.92,-98 511.85,-98&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;511.65,-101.5 521.65,-98 511.65,-94.5 511.65,-101.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;465.93&quot; y=&quot;-102.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;publishes&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCK Tests --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TCK Tests&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;600.24,-49 523.19,-49 523.19,-13 600.24,-13 600.24,-49&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;561.72&quot; y=&quot;-26.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TCK Tests&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Sun Microsystems&amp;#45;&amp;gt;TCK Tests --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Sun Microsystems-&gt;TCK Tests&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M349.45,-86.48C394.59,-74.63 464.78,-56.19 511.72,-43.87&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;512.58,-47.26 521.37,-41.33 510.8,-40.49 512.58,-47.26&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;465.93&quot; y=&quot;-66.69&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;provides&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Reference Impl --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Reference Impl&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;613.05,-170 510.38,-170 510.38,-134 613.05,-134 613.05,-170&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;561.72&quot; y=&quot;-147.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Reference Impl&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Sun Microsystems&amp;#45;&amp;gt;Reference Impl --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Sun Microsystems-&gt;Reference Impl&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M355.69,-108.6C396.81,-117.31 455.2,-129.67 499.16,-138.97&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;498.31,-142.37 508.81,-141.01 499.76,-135.52 498.31,-142.37&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;465.93&quot; y=&quot;-141.72&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;provides&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Compliant Brand --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Compliant Brand&lt;/title&gt;
&lt;ellipse fill=&quot;lightpink&quot; stroke=&quot;black&quot; cx=&quot;805.02&quot; cy=&quot;-31&quot; rx=&quot;77.82&quot; ry=&quot;18&quot;&gt;&lt;/ellipse&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;805.02&quot; y=&quot;-26.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Compliant Brand&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCK Tests&amp;#45;&amp;gt;Compliant Brand --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TCK Tests-&gt;Compliant Brand&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M600.68,-31C631.43,-31 675.99,-31 715.56,-31&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;715.33,-34.5 725.33,-31 715.33,-27.5 715.33,-34.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;670.12&quot; y=&quot;-35.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;pass → certify&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Vendor&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M45.99,-36C45.99,-36 12,-36 12,-36 6,-36 0,-30 0,-24 0,-24 0,-12 0,-12 0,-6 6,0 12,0 12,0 45.99,0 45.99,0 51.99,0 57.99,-6 57.99,-12 57.99,-12 57.99,-24 57.99,-24 57.99,-30 51.99,-36 45.99,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;28.99&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Vendor&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor Impl --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Vendor Impl&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;348.55,-36 260.62,-36 260.62,0 348.55,0 348.55,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;304.59&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Vendor Impl&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor&amp;#45;&amp;gt;Vendor Impl --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Vendor-&gt;Vendor Impl&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M58.24,-18C103.08,-18 191.32,-18 248.85,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;248.77,-21.5 258.77,-18 248.77,-14.5 248.77,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;122.84&quot; y=&quot;-22.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;implements spec&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor Impl&amp;#45;&amp;gt;TCK Tests --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Vendor Impl-&gt;TCK Tests&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M348.71,-16.27C386.64,-15.23 443.28,-14.83 492.38,-19.2 498.76,-19.77 505.43,-20.61 512.01,-21.58&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;510.99,-24.96 521.41,-23.09 512.09,-18.05 510.99,-24.96&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;465.93&quot; y=&quot;-23.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;runs tests&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;TCK (Test Compatibility Kit)&lt;/strong&gt;: Comprehensive test suite from Sun&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Certification&lt;/strong&gt;: “J2EE-compliant” brand issued by Sun&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reference Implementation&lt;/strong&gt;: Free, low-end implementation for developers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor competition&lt;/strong&gt;: Compliance encourages innovation and price competition&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Customer confidence&lt;/strong&gt;: Certified products guaranteed to work per spec&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../j2ee-specification&quot; class=&quot;internal alias&quot; data-slug=&quot;j2ee-specification&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;J2EE Specification&lt;/a&gt; — compliance verifies spec implementation&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — containers must be J2EE-compliant&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — compliance applies to J2EE platform&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../component-architecture-soa&quot; class=&quot;internal alias&quot; data-slug=&quot;component-architecture-soa&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Component Architecture&lt;/a&gt; — compliant servers implement component model&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Incompatibilities&lt;/strong&gt;: Ambiguities in spec can cause vendor differences despite compliance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Human nature of competition&lt;/strong&gt;: Vendors may interpret ambiguous specs differently&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version lag&lt;/strong&gt;: Some vendors slow to implement new J2EE versions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proprietary extensions&lt;/strong&gt;: Vendors add features beyond spec, creating lock-in&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>j2ee-specification</title>
    <link href="https://animishraa05.github.io/wiki/ejb/j2ee-specification" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/j2ee-specification.md" />
    <summary>The Problem Enterprise software needs a standard set of APIs and behaviors so that applications work across different vendor implementations.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="j2ee" label="j2ee" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Enterprise software needs a standard set of APIs and behaviors so that applications work across different vendor implementations. Without a specification, each vendor creates proprietary, incompatible systems, locking customers into a single vendor.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE is a specification (a set of rules/PDFs), not a product. It defines the APIs and behaviors that vendors must implement to be “J2EE-compliant.” This ensures portability across different application servers (WebLogic, GlassFish, JBoss).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;JCP (Java Community Process) creates the specification documents (PDFs)&lt;/li&gt;
&lt;li&gt;Each specification version locks down specific API versions (EJB 2.1, Servlet 2.4, etc.)&lt;/li&gt;
&lt;li&gt;Vendors implement the specification in their products&lt;/li&gt;
&lt;li&gt;Sun provides a Test Compatibility Kit (TCK) to verify compliance&lt;/li&gt;
&lt;li&gt;Compliant products can be certified and branded as “J2EE-compliant”&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE 1.4 bundles EJB 2.1, JMS 1.1, JTA 1.0, etc. as the de facto versions.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;465pt&quot; height=&quot;295pt&quot; viewBox=&quot;0.00 0.00 465.00 295.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 290.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-290.6 460.71,-290.6 460.71,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- JCP (Java Community Process) --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JCP (Java Community Process)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M198.32,-285.46C198.32,-285.46 34,-269.74 34,-269.74 28.02,-269.17 28.02,-268.03 34,-267.46 34,-267.46 198.32,-251.74 198.32,-251.74 204.29,-251.17 216.24,-251.17 222.21,-251.74 222.21,-251.74 386.53,-267.46 386.53,-267.46 392.51,-268.03 392.51,-269.17 386.53,-269.74 386.53,-269.74 222.21,-285.46 222.21,-285.46 216.24,-286.03 204.29,-286.03 198.32,-285.46&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;210.27&quot; y=&quot;-264.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JCP (Java Community Process)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Specification --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2EE Specification&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;354.72,-197.8 237.81,-197.8 237.81,-161.8 360.72,-161.8 360.72,-191.8 354.72,-197.8&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;354.72,-197.8 354.72,-191.8&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;360.72,-191.8 354.72,-191.8&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;299.27&quot; y=&quot;-175.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2EE Specification&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JCP (Java Community Process)&amp;#45;&amp;gt;J2EE Specification --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JCP (Java Community Process)-&gt;J2EE Specification&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M226.59,-251.68C239.72,-238.88 258.4,-220.66 273.53,-205.9&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;275.72,-208.65 280.44,-199.16 270.83,-203.64 275.72,-208.65&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;282.16&quot; y=&quot;-220&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;creates&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCK (Test Compatibility Kit) --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TCK (Test Compatibility Kit)&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;217.06,-197.8 33.47,-197.8 33.47,-161.8 217.06,-161.8 217.06,-197.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;125.27&quot; y=&quot;-175.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TCK (Test Compatibility Kit)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JCP (Java Community Process)&amp;#45;&amp;gt;TCK (Test Compatibility Kit) --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JCP (Java Community Process)-&gt;TCK (Test Compatibility Kit)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M194.67,-251.68C182.25,-239 164.63,-220.99 150.24,-206.31&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;152.77,-203.89 143.27,-199.19 147.77,-208.78 152.77,-203.89&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;199.49&quot; y=&quot;-220&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;provides&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor A (WebLogic) --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Vendor A (WebLogic)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M144.02,-109C144.02,-109 24.51,-109 24.51,-109 18.51,-109 12.51,-103 12.51,-97 12.51,-97 12.51,-85 12.51,-85 12.51,-79 18.51,-73 24.51,-73 24.51,-73 144.02,-73 144.02,-73 150.02,-73 156.02,-79 156.02,-85 156.02,-85 156.02,-97 156.02,-97 156.02,-103 150.02,-109 144.02,-109&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;84.27&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Vendor A (WebLogic)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Specification&amp;#45;&amp;gt;Vendor A (WebLogic) --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE Specification-&gt;Vendor A (WebLogic)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M237.61,-163.48C206.81,-155.62 174.66,-147.04 167.94,-143.8 156.64,-138.36 155.76,-133.87 145.27,-127 139.09,-122.96 132.42,-118.87 125.85,-114.99&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;128.06,-112.23 117.66,-110.24 124.55,-118.28 128.06,-112.23&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;200.6&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;implements&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor B (GlassFish) --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Vendor B (GlassFish)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M444.71,-109C444.71,-109 329.82,-109 329.82,-109 323.82,-109 317.82,-103 317.82,-97 317.82,-97 317.82,-85 317.82,-85 317.82,-79 323.82,-73 329.82,-73 329.82,-73 444.71,-73 444.71,-73 450.71,-73 456.71,-79 456.71,-85 456.71,-85 456.71,-97 456.71,-97 456.71,-103 450.71,-109 444.71,-109&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;387.27&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Vendor B (GlassFish)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Specification&amp;#45;&amp;gt;Vendor B (GlassFish) --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE Specification-&gt;Vendor B (GlassFish)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M336.46,-161.37C344.6,-156.45 352.72,-150.56 359.27,-143.8 365.96,-136.88 371.52,-128.04 375.88,-119.62&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;378.97,-121.28 380.09,-110.74 372.64,-118.28 378.97,-121.28&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;404.4&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;implements&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor C (JBoss) --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Vendor C (JBoss)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M284.43,-109C284.43,-109 192.1,-109 192.1,-109 186.1,-109 180.1,-103 180.1,-97 180.1,-97 180.1,-85 180.1,-85 180.1,-79 186.1,-73 192.1,-73 192.1,-73 284.43,-73 284.43,-73 290.43,-73 296.43,-79 296.43,-85 296.43,-85 296.43,-97 296.43,-97 296.43,-103 290.43,-109 284.43,-109&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;238.27&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Vendor C (JBoss)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Specification&amp;#45;&amp;gt;Vendor C (JBoss) --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE Specification-&gt;Vendor C (JBoss)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M295.76,-161.36C293.04,-150.74 288.47,-137.29 281.27,-127 278.73,-123.38 275.72,-119.93 272.48,-116.71&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;275.03,-114.29 265.26,-110.21 270.35,-119.5 275.03,-114.29&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;322.36&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;implements&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCK (Test Compatibility Kit)&amp;#45;&amp;gt;Vendor A (WebLogic) --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TCK (Test Compatibility Kit)-&gt;Vendor A (WebLogic)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M88.39,-161.37C81.95,-156.61 76.13,-150.78 72.38,-143.8 68.46,-136.51 68.75,-127.96 70.77,-119.94&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;74.06,-121.16 74.04,-110.56 67.45,-118.85 74.06,-121.16&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;84.82&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;tests&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCK (Test Compatibility Kit)&amp;#45;&amp;gt;Vendor B (GlassFish) --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TCK (Test Compatibility Kit)-&gt;Vendor B (GlassFish)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M193.61,-161.32C207.18,-156.58 221.02,-150.77 233.27,-143.8 243.09,-138.21 242.38,-132.3 252.38,-127 262.57,-121.59 283.9,-115.36 306.64,-109.66&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;307.17,-113.13 316.05,-107.36 305.5,-106.34 307.17,-113.13&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;264.82&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;tests&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCK (Test Compatibility Kit)&amp;#45;&amp;gt;Vendor C (JBoss) --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TCK (Test Compatibility Kit)-&gt;Vendor C (JBoss)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M118.06,-161.33C114.82,-150.44 113.14,-136.7 120.38,-127 123.81,-122.4 145.16,-115.49 168.77,-109.02&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;169.5,-112.45 178.25,-106.48 167.69,-105.69 169.5,-112.45&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;132.82&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;tests&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Compliant Product --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Compliant Product&lt;/title&gt;
&lt;ellipse fill=&quot;lightblue&quot; stroke=&quot;black&quot; cx=&quot;84.27&quot; cy=&quot;-18&quot; rx=&quot;84.27&quot; ry=&quot;18&quot;&gt;&lt;/ellipse&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;84.27&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Compliant Product&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Vendor A (WebLogic)&amp;#45;&amp;gt;Compliant Product --&gt;
&lt;g id=&quot;edge9&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Vendor A (WebLogic)-&gt;Compliant Product&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M84.27,-72.81C84.27,-65.23 84.27,-56.1 84.27,-47.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;87.77,-47.54 84.27,-37.54 80.77,-47.54 87.77,-47.54&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Not a product&lt;/strong&gt;: Specification is a document, not software you run&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor-neutral&lt;/strong&gt;: Not tied to one vendor, encourages competition&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Portable&lt;/strong&gt;: Code runs on any compliant server&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versioned&lt;/strong&gt;: Each J2EE version bundles specific API versions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Community-driven&lt;/strong&gt;: Created by JCP with industry experts&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../component-architecture-soa&quot; class=&quot;internal alias&quot; data-slug=&quot;component-architecture-soa&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Component Architecture &amp;#x26; SOA&lt;/a&gt; — J2EE implements component architecture&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — EJB is part of J2EE&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../j2ee-compliance&quot; class=&quot;internal alias&quot; data-slug=&quot;j2ee-compliance&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;J2EE Compliance&lt;/a&gt; — how vendors prove they implement the spec&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — J2EE is one of three Java platforms&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../proprietary-system&quot; class=&quot;internal alias&quot; data-slug=&quot;proprietary-system&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Proprietary System&lt;/a&gt; — J2EE is open standard&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Ambiguities&lt;/strong&gt;: Specifications may have ambiguous points leading to vendor differences&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version mismatches&lt;/strong&gt;: Mixing APIs from different J2EE versions causes issues&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor extensions&lt;/strong&gt;: Vendors may add proprietary features beyond the spec&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compliance != Compatibility&lt;/strong&gt;: Technically compliant products may still differ&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>J2EE Technology Stack — Platform Components Compared</title>
    <link href="https://animishraa05.github.io/wiki/ejb/j2ee-tech-stack-compared" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/j2ee-tech-stack-compared.md" />
    <summary>The Problem J2EE has many APIs (EJB, JMS, JDBC, JNDI, Servlets, JSP, etc.). Students often memorize them as a random list.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="j2ee" label="j2ee" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE has many APIs (EJB, JMS, JDBC, JNDI, Servlets, JSP, etc.). Students often memorize them as a random list. How do we organize them into a logical structure that shows relationships and purposes?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE technologies can be grouped into 5 logical layers: Presentation/Web, Business Logic, Communication/Integration, Data/Persistence, and Foundation Services. This layered view shows how technologies relate and depend on each other.&lt;/p&gt;
&lt;h2 id=&quot;comparison-by-layer&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Comparison by Layer&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#comparison-by-layer&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;1-presentation--web-technologies-client-facing&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;1. Presentation / Web Technologies (Client-Facing)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#1-presentation--web-technologies-client-facing&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Technology&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;th&gt;Key Characteristic&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Servlets&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;HTTP request/response handling&lt;/td&gt;&lt;td&gt;Java classes, foundation of web tier&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JSP&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Dynamic HTML generation&lt;/td&gt;&lt;td&gt;Compiles to servlets, HTML-centric&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Relationship&lt;/strong&gt;: JSP compiles to servlets. Both handle web requests but JSP separates UI from logic.&lt;/p&gt;
&lt;h3 id=&quot;2-business-logic-layer-the-brain&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;2. Business Logic Layer (The Brain)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#2-business-logic-layer-the-brain&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Technology&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;th&gt;Key Characteristic&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;EJB&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Server-side business components&lt;/td&gt;&lt;td&gt;Container-managed services (transactions, security)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Relationship&lt;/strong&gt;: EJB is the cornerstone of J2EE. Servlets/JSP often call EJBs for business logic.&lt;/p&gt;
&lt;h3 id=&quot;3-communication--integration&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;3. Communication &amp;#x26; Integration&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#3-communication--integration&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Technology&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;th&gt;Key Characteristic&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;RMI-IIOP&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Synchronous distributed objects&lt;/td&gt;&lt;td&gt;Official J2EE remoting, CORBA-compatible&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JMS&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Asynchronous messaging&lt;/td&gt;&lt;td&gt;Two domains: PTP (Queue) and Pub/Sub (Topic)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JCA&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Legacy system integration&lt;/td&gt;&lt;td&gt;Resource adapters for SAP, CICS, etc.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JAX-RPC&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Web Services (SOAP)&lt;/td&gt;&lt;td&gt;Two endpoint models (servlet or EJB-based)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Java IDL&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;CORBA integration&lt;/td&gt;&lt;td&gt;Cross-language communication&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Relationship&lt;/strong&gt;: RMI-IIOP is used by EJBs for remoting. JMS provides async alternative. JCA connects to legacy. JAX-RPC for web services.&lt;/p&gt;
&lt;h3 id=&quot;4-data--persistence&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;4. Data &amp;#x26; Persistence&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#4-data--persistence&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Technology&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;th&gt;Key Characteristic&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JDBC&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Relational database access&lt;/td&gt;&lt;td&gt;Universal API, works with any RDBMS&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JAXP&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;XML parsing&lt;/td&gt;&lt;td&gt;Implementation-neutral (DOM/SAX)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Relationship&lt;/strong&gt;: EJBs often use JDBC for database access. JAXP for XML data in web services.&lt;/p&gt;
&lt;h3 id=&quot;5-foundation-services-middleware&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;5. Foundation Services (Middleware)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#5-foundation-services-middleware&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;






























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Technology&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;th&gt;Key Characteristic&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JNDI&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Naming and directory&lt;/td&gt;&lt;td&gt;Location transparency, unified API for all directories&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JTA/JTS&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Transactions&lt;/td&gt;&lt;td&gt;Distributed transactions across resources&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JAAS&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Security&lt;/td&gt;&lt;td&gt;Pluggable authentication and authorization&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;JavaMail&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Email&lt;/td&gt;&lt;td&gt;Platform-independent email sending&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Relationship&lt;/strong&gt;: JNDI is used by EJBs to look up resources. JTA provides transactions. JAAS provides security.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;904pt&quot; height=&quot;324pt&quot; viewBox=&quot;0.00 0.00 904.00 324.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 320)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-320 900,-320 900,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_presentation&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;436,-231.2 436,-308 586,-308 586,-231.2 436,-231.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;511&quot; y=&quot;-291.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. Presentation/Web&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_business&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;458,-119.6 458,-196.4 574,-196.4 574,-119.6 458,-119.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;516&quot; y=&quot;-179.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Business Logic&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust3&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_comms&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-8 8,-84.8 418,-84.8 418,-8 8,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;213&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. Communication/Integration&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust4&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_data&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;426,-8 426,-84.8 568,-84.8 568,-8 426,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;497&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;4. Data/Persistence&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust5&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_services&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;576,-8 576,-84.8 888,-84.8 888,-8 576,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;732&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;5. Foundation Services&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Servlets --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Servlets&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;505.55,-275.2 444.45,-275.2 444.45,-239.2 505.55,-239.2 505.55,-275.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;475&quot; y=&quot;-253&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Servlets&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJB&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;516,-163.6 477.63,-145.6 516,-127.6 554.37,-145.6 516,-163.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;516&quot; y=&quot;-141.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Servlets&amp;#45;&amp;gt;EJB --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Servlets-&gt;EJB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M481.41,-239.07C488.13,-221.09 498.78,-192.62 506.49,-172.02&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;509.67,-173.51 509.9,-162.91 503.12,-171.05 509.67,-173.51&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;507.1&quot; y=&quot;-208.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;calls&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JSP --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JSP&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;578,-275.2 524,-275.2 524,-239.2 578,-239.2 578,-275.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;551&quot; y=&quot;-253&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JSP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JSP&amp;#45;&amp;gt;EJB --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JSP-&gt;EJB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M545.53,-239.07C539.85,-221.28 530.88,-193.2 524.32,-172.65&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;527.7,-171.74 521.33,-163.28 521.04,-173.87 527.7,-171.74&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;552.51&quot; y=&quot;-208.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;calls&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RMI&amp;#45;IIOP --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RMI-IIOP&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;90.17,-52 15.83,-52 15.83,-16 90.17,-16 90.17,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;53&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;RMI-IIOP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB&amp;#45;&amp;gt;RMI&amp;#45;IIOP --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB-&gt;RMI-IIOP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M479.63,-144.23C415,-142.86 276.28,-136.69 162.89,-109.6 133.26,-102.52 124.18,-101.94 99,-84.8 89.32,-78.21 80.22,-69.23 72.71,-60.7&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;75.58,-58.68 66.47,-53.26 70.22,-63.18 75.58,-58.68&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;174.94&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;uses&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JMS --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JMS&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;162,-52 108,-52 108,-16 162,-16 162,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;135&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JMS&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB&amp;#45;&amp;gt;JMS --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB-&gt;JMS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M483.93,-142.13C408.69,-135.84 223.2,-117.4 171,-84.8 162.02,-79.19 154.6,-70.46 148.87,-61.86&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;151.88,-60.07 143.72,-53.31 145.89,-63.68 151.88,-60.07&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252.3&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;uses&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JDBC --&gt;
&lt;g id=&quot;node9&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JDBC&lt;/title&gt;
&lt;polygon fill=&quot;lightpink&quot; stroke=&quot;black&quot; points=&quot;488,-52 434,-52 434,-16 488,-16 488,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;461&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JDBC&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB&amp;#45;&amp;gt;JDBC --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB-&gt;JDBC&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M509.03,-130.72C500.48,-113.67 485.76,-84.34 474.87,-62.63&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;478.01,-61.1 470.4,-53.73 471.76,-64.24 478.01,-61.1&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;510.27&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;uses&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI --&gt;
&lt;g id=&quot;node11&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JNDI&lt;/title&gt;
&lt;polygon fill=&quot;lightcyan&quot; stroke=&quot;black&quot; points=&quot;638,-52 584,-52 584,-16 638,-16 638,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;611&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB&amp;#45;&amp;gt;JNDI --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB-&gt;JNDI&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M527.47,-132.97C539.02,-121.12 557.19,-102.08 572,-84.8 578.4,-77.33 585.1,-68.99 591.1,-61.3&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;593.74,-63.61 597.08,-53.55 588.2,-59.33 593.74,-63.61&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;586.84&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;lookups&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JTA/JTS --&gt;
&lt;g id=&quot;node12&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JTA/JTS&lt;/title&gt;
&lt;polygon fill=&quot;lightcyan&quot; stroke=&quot;black&quot; points=&quot;721.89,-52 656.11,-52 656.11,-16 721.89,-16 721.89,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;689&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JTA/JTS&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB&amp;#45;&amp;gt;JTA/JTS --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB-&gt;JTA/JTS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M539.52,-138.17C559.67,-132.18 589.13,-122.28 613,-109.6 629.52,-100.83 633.32,-97.55 647,-84.8 654.61,-77.71 662.18,-69.28 668.75,-61.39&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;671.42,-63.65 674.99,-53.67 665.98,-59.25 671.42,-63.65&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;671.37&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;transactions&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAAS --&gt;
&lt;g id=&quot;node13&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAAS&lt;/title&gt;
&lt;polygon fill=&quot;lightcyan&quot; stroke=&quot;black&quot; points=&quot;794,-52 740,-52 740,-16 794,-16 794,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;767&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JAAS&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB&amp;#45;&amp;gt;JAAS --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB-&gt;JAAS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M554,-144.89C594.81,-143.64 660.32,-136.97 709,-109.6 728.3,-98.75 743.37,-78.6 753.31,-61.97&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;756.22,-63.94 758.08,-53.51 750.12,-60.5 756.22,-63.94&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;751.25&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;security&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JCA --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JCA&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;234,-52 180,-52 180,-16 234,-16 234,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;207&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JCA&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAX&amp;#45;RPC --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAX-RPC&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;324.4,-52 251.6,-52 251.6,-16 324.4,-16 324.4,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;288&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JAX-RPC&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Java IDL --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Java IDL&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;409.85,-52 342.15,-52 342.15,-16 409.85,-16 409.85,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;376&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Java IDL&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAXP --&gt;
&lt;g id=&quot;node10&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAXP&lt;/title&gt;
&lt;polygon fill=&quot;lightpink&quot; stroke=&quot;black&quot; points=&quot;560,-52 506,-52 506,-16 560,-16 560,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;533&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JAXP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JavaMail --&gt;
&lt;g id=&quot;node14&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JavaMail&lt;/title&gt;
&lt;polygon fill=&quot;lightcyan&quot; stroke=&quot;black&quot; points=&quot;879.66,-52 812.34,-52 812.34,-16 879.66,-16 879.66,-52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;846&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JavaMail&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-insights&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Insights&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-insights&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Layered dependency&lt;/strong&gt;: Presentation → Business → Integration → Data, with Foundation Services supporting all layers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EJB is central&lt;/strong&gt;: Most technologies either support EJBs or are used by them&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two communication paradigms&lt;/strong&gt;: Synchronous (RMI-IIOP) vs Asynchronous (JMS)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern equivalent&lt;/strong&gt;: Spring Boot simplifies this by embedding many of these (Spring Data = JDBC, Spring Security = JAAS, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exam strategy&lt;/strong&gt;: Group by layer, not alphabetically—shows understanding of architecture&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;All technology pages listed above:
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;a href=&quot;../../servlets&quot; class=&quot;internal alias&quot; data-slug=&quot;servlets&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Servlets&lt;/a&gt;, &lt;a href=&quot;../../jsp&quot; class=&quot;internal alias&quot; data-slug=&quot;jsp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JSP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;, &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt;, &lt;a href=&quot;../../message-driven-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;message-driven-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Message-Driven Bean&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../rmi-iiop&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-iiop&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI-IIOP&lt;/a&gt;, &lt;a href=&quot;../../jms&quot; class=&quot;internal alias&quot; data-slug=&quot;jms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JMS&lt;/a&gt;, &lt;a href=&quot;../../jca&quot; class=&quot;internal alias&quot; data-slug=&quot;jca&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JCA&lt;/a&gt;, &lt;a href=&quot;../../jax-rpc&quot; class=&quot;internal alias&quot; data-slug=&quot;jax-rpc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JAX-RPC&lt;/a&gt;, &lt;a href=&quot;../../java-idl&quot; class=&quot;internal alias&quot; data-slug=&quot;java-idl&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java IDL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt;, &lt;a href=&quot;../../jaxp&quot; class=&quot;internal alias&quot; data-slug=&quot;jaxp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JAXP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt;, &lt;a href=&quot;../../jta-jts&quot; class=&quot;internal alias&quot; data-slug=&quot;jta-jts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JTS&lt;/a&gt;, &lt;a href=&quot;../../jaas&quot; class=&quot;internal alias&quot; data-slug=&quot;jaas&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JAAS&lt;/a&gt;, &lt;a href=&quot;../../javamail&quot; class=&quot;internal alias&quot; data-slug=&quot;javamail&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JavaMail&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — all are part of J2EE&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt; — foundation services are middleware&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Overlap&lt;/strong&gt;: Some technologies span layers (JNDI is used in web tier too)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version differences&lt;/strong&gt;: J2EE 1.4 vs Java EE 5+ have different API versions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern replacements&lt;/strong&gt;: JAX-RPC → JAX-WS, Java IDL rarely used today&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Spring alternative&lt;/strong&gt;: Modern apps use Spring which abstracts many of these&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jaas</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jaas" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jaas.md" />
    <summary>The Problem J2EE applications need standardized security: verifying who the user is (authentication) and what they’re allowed to do (authorization).</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="security" label="security" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE applications need standardized security: verifying who the user is (authentication) and what they’re allowed to do (authorization). Without a standard API, each application implements security differently, leading to inconsistencies and security holes.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JAAS (Java Authentication and Authorization Service) is the standard API for performing security operations in J2EE. It enables plugging in authentication mechanisms into J2EE application servers and provides both authentication and authorization services.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: Verifies user identity (login, password, certificates, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authorization&lt;/strong&gt;: Determines what authenticated user can do (roles, permissions)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pluggable&lt;/strong&gt;: Different authentication mechanisms can be plugged in (LDAP, database, Kerberos, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE integration&lt;/strong&gt;: Works with EJB security (Chapter 13 covers EJB security details)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standard API&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;JAAS uses a callback mechanism for authentication and Policy-based authorization.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;460pt&quot; height=&quot;206pt&quot; viewBox=&quot;0.00 0.00 460.00 206.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 202)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-202 456.32,-202 456.32,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- User --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;User&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;54,-117 0,-117 0,-81 54,-81 54,-117&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27&quot; y=&quot;-94.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;User&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAAS --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAAS&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;167.02,-117 118.78,-99 167.02,-81 215.27,-99 167.02,-117&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;167.02&quot; y=&quot;-94.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JAAS&lt;/text&gt;
&lt;/g&gt;
&lt;!-- User&amp;#45;&amp;gt;JAAS --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;User-&gt;JAAS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M54.29,-99C68.98,-99 87.95,-99 106.06,-99&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;105.97,-102.5 115.97,-99 105.97,-95.5 105.97,-102.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;86.39&quot; y=&quot;-103.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;login&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Container --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJB Container&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;452.32,-198 354.28,-198 354.28,-162 452.32,-162 452.32,-198&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.3&quot; y=&quot;-175.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAAS&amp;#45;&amp;gt;EJB Container --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAAS-&gt;EJB Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M184.15,-110.87C196.91,-119.75 215.48,-131.6 233.27,-139 268.46,-153.63 310.05,-163.8 343.16,-170.35&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;342.08,-173.71 352.56,-172.15 343.4,-166.84 342.08,-173.71&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;284.77&quot; y=&quot;-172.31&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;authorized request&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LDAP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M430.3,-140.73C430.3,-142.53 418.2,-144 403.3,-144 388.4,-144 376.3,-142.53 376.3,-140.73 376.3,-140.73 376.3,-111.27 376.3,-111.27 376.3,-109.47 388.4,-108 403.3,-108 418.2,-108 430.3,-109.47 430.3,-111.27 430.3,-111.27 430.3,-140.73 430.3,-140.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M430.3,-140.73C430.3,-138.92 418.2,-137.45 403.3,-137.45 388.4,-137.45 376.3,-138.92 376.3,-140.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.3&quot; y=&quot;-121.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LDAP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAAS&amp;#45;&amp;gt;LDAP --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAAS-&gt;LDAP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M205.14,-103.28C248.76,-108.3 320.71,-116.6 364.58,-121.65&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;364.05,-125.12 374.39,-122.78 364.86,-118.16 364.05,-125.12&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;284.77&quot; y=&quot;-122.22&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;authenticate&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Database --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Database&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M436.95,-86.73C436.95,-88.53 421.87,-90 403.3,-90 384.73,-90 369.65,-88.53 369.65,-86.73 369.65,-86.73 369.65,-57.27 369.65,-57.27 369.65,-55.47 384.73,-54 403.3,-54 421.87,-54 436.95,-55.47 436.95,-57.27 436.95,-57.27 436.95,-86.73 436.95,-86.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M436.95,-86.73C436.95,-84.92 421.87,-83.45 403.3,-83.45 384.73,-83.45 369.65,-84.92 369.65,-86.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.3&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Database&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAAS&amp;#45;&amp;gt;Database --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAAS-&gt;Database&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M198.44,-92.31C209.38,-90.1 221.83,-87.8 233.27,-86.2 275.4,-80.32 323.81,-76.55 358,-74.39&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;358.18,-77.88 367.95,-73.78 357.75,-70.89 358.18,-77.88&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;284.77&quot; y=&quot;-90.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;authenticate&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Kerberos --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Kerberos&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M436.95,-32.73C436.95,-34.53 421.87,-36 403.3,-36 384.73,-36 369.64,-34.53 369.64,-32.73 369.64,-32.73 369.64,-3.27 369.64,-3.27 369.64,-1.47 384.73,0 403.3,0 421.87,0 436.95,-1.47 436.95,-3.27 436.95,-3.27 436.95,-32.73 436.95,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M436.95,-32.73C436.95,-30.92 421.87,-29.45 403.3,-29.45 384.73,-29.45 369.64,-30.92 369.64,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.3&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Kerberos&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAAS&amp;#45;&amp;gt;Kerberos --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAAS-&gt;Kerberos&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M182.89,-86.63C195.54,-76.72 214.57,-63.19 233.27,-55.2 273.73,-37.91 323.21,-28.22 358.16,-23.11&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;358.49,-26.59 367.92,-21.75 357.53,-19.66 358.49,-26.59&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;284.77&quot; y=&quot;-59.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;authenticate&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Pluggable authentication&lt;/strong&gt;: Swap auth mechanisms without code changes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication + Authorization&lt;/strong&gt;: Both identity and permissions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Callback-based&lt;/strong&gt;: Flexible authentication dialog&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Policy-based&lt;/strong&gt;: Authorization via security policies&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — container uses JAAS for EJB security&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — JAAS is part of J2EE&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../application-vs-system-exceptions&quot; class=&quot;internal alias&quot; data-slug=&quot;application-vs-system-exceptions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Application vs System Exceptions&lt;/a&gt; — security exceptions&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt; — security is a middleware service&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Configuration complexity&lt;/strong&gt;: JAAS config files can be tricky&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Callback handling&lt;/strong&gt;: Custom callbacks need careful implementation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Policy management&lt;/strong&gt;: Authorization policies must be properly configured&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chapter 13&lt;/strong&gt;: See EJB-specific security details there&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>java-idl</title>
    <link href="https://animishraa05.github.io/wiki/ejb/java-idl" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/java-idl.md" />
    <summary>The Problem Java applications need to communicate with objects written in other languages (C++, Python, etc.) in a distributed environment.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="corba" label="corba" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Java applications need to communicate with objects written in other languages (C++, Python, etc.) in a distributed environment. CORBA is the standard for cross-language distributed objects, but Java needs a way to participate in CORBA ecosystems.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Java IDL is Sun’s Java-based implementation of CORBA (Common Object Request Broker Architecture). It allows Java objects to integrate with other languages through CORBA services, making J2EE fully compatible with CORBA.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;IDL (Interface Definition Language)&lt;/strong&gt;: Language-neutral way to define interfaces&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Java IDL&lt;/strong&gt;: Maps IDL interfaces to Java interfaces&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CORBA ORB&lt;/strong&gt;: Object Request Broker handles cross-language communication&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IIOP protocol&lt;/strong&gt;: Internet Inter-ORB Protocol for CORBA communication&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE compatibility&lt;/strong&gt;: Full CORBA compatibility completes Java 2 Platform&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Appendix B of the source discusses CORBA interoperability in detail.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;599pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 599.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 595.01,-94 595.01,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Java Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Java Client&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;78.6,-63 0,-63 0,-27 78.6,-27 78.6,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;39.3&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Java Client&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Java IDL --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Java IDL&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;206.29,-63 140.25,-45 206.29,-27 272.33,-45 206.29,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;206.29&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Java IDL&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Java Client&amp;#45;&amp;gt;Java IDL --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Java Client-&gt;Java IDL&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M78.98,-45C93.38,-45 110.28,-45 126.95,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;126.91,-48.5 136.91,-45 126.91,-41.5 126.91,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;109.42&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;calls&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CORBA ORB --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CORBA ORB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M420.08,-63C420.08,-63 347.56,-63 347.56,-63 341.56,-63 335.56,-57 335.56,-51 335.56,-51 335.56,-39 335.56,-39 335.56,-33 341.56,-27 347.56,-27 347.56,-27 420.08,-27 420.08,-27 426.08,-27 432.08,-33 432.08,-39 432.08,-39 432.08,-51 432.08,-51 432.08,-57 426.08,-63 420.08,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;383.82&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CORBA ORB&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Java IDL&amp;#45;&amp;gt;CORBA ORB --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Java IDL-&gt;CORBA ORB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M274.15,-45C290.52,-45 307.92,-45 323.89,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;323.72,-48.5 333.72,-45 323.72,-41.5 323.72,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;303.95&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IIOP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C++ Server --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;C++ Server&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;583.74,-90 502.57,-90 502.57,-54 583.74,-54 583.74,-90&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;543.15&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;C++ Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CORBA ORB&amp;#45;&amp;gt;C++ Server --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CORBA ORB-&gt;C++ Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M432.45,-53.17C450.87,-56.34 472.01,-59.96 490.77,-63.18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;490.17,-66.63 500.61,-64.87 491.35,-59.73 490.17,-66.63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;463.69&quot; y=&quot;-64.32&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IIOP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Python Server --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Python Server&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;591.01,-36 495.3,-36 495.3,0 591.01,0 591.01,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;543.15&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Python Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CORBA ORB&amp;#45;&amp;gt;Python Server --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CORBA ORB-&gt;Python Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M432.45,-36.83C448.7,-34.04 467.05,-30.89 484.03,-27.97&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;484.2,-31.5 493.46,-26.36 483.01,-24.6 484.2,-31.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;463.69&quot; y=&quot;-37.32&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IIOP&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Cross-language&lt;/strong&gt;: Java can talk to C++, Python, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CORBA standard&lt;/strong&gt;: Implements CORBA 2.x specification&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IIOP protocol&lt;/strong&gt;: Standard wire protocol for CORBA&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE integration&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Full CORBA services&lt;/strong&gt;: Leverages complete CORBA service set&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../rmi-remote-method-invocation&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-remote-method-invocation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI&lt;/a&gt; — similar concept, Java-only vs cross-language&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../rmi-iiop&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-iiop&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI-IIOP&lt;/a&gt; — RMI over IIOP protocol (used in J2EE)&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../distributed-objects&quot; class=&quot;internal alias&quot; data-slug=&quot;distributed-objects&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Distributed Objects&lt;/a&gt; — Java IDL enables cross-language distributed objects&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — Java IDL is part of J2EE&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Legacy technology&lt;/strong&gt;: CORBA/IDL largely replaced by REST/JSON&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Complexity&lt;/strong&gt;: CORBA has steep learning curve&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IIOP firewall issues&lt;/strong&gt;: IIOP may be blocked by firewalls&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern alternative&lt;/strong&gt;: Use REST or gRPC for cross-language communication&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>java-platforms</title>
    <link href="https://animishraa05.github.io/wiki/ejb/java-platforms" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/java-platforms.md" />
    <summary>The Problem Java targets different types of devices and use cases: tiny mobile devices, standard desktop applications, and large enterprise servers.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="java" label="java" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Java targets different types of devices and use cases: tiny mobile devices, standard desktop applications, and large enterprise servers. One-size-fits-all doesn’t work—each needs different APIs and capabilities. How does Java organize its platform offerings?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Java has three platforms in a hierarchical relationship: J2ME (Micro Edition) for mobile/embedded, J2SE (Standard Edition) for desktop/apps, and J2EE (Enterprise Edition) for server-side enterprise applications. Each platform is a conceptual superset of the next smaller platform.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;J2ME&lt;/strong&gt; (Micro Edition): Restricted Java for mobile devices (phones, PDAs, set-top boxes). Limited APIs due to performance/memory constraints.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2SE&lt;/strong&gt; (Standard Edition): Core Java libraries (I/O, GUI, networking). Foundation for all Java development.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE&lt;/strong&gt; (Enterprise Edition): Builds on J2SE, adds enterprise APIs (EJB, JMS, JDBC, etc.). Conceptual superset of J2SE.&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;A J2EE-compliant product must implement all of J2SE plus the J2EE-specific APIs.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;171pt&quot; height=&quot;339pt&quot; viewBox=&quot;0.00 0.00 171.00 339.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 335.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-335.2 167.34,-335.2 167.34,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- J2EE --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2EE&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;158.71,-331.2 4.63,-331.2 4.63,-256 158.71,-256 158.71,-331.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-314.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2EE&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-297.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Enterprise)&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-281&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB, JMS, JDBC, JNDI,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-264.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Servlets, JSP, etc.&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2SE --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2SE&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;148.18,-203.2 15.16,-203.2 15.16,-128 148.18,-128 148.18,-203.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-186.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2SE&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-169.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Standard)&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-153&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Core Java: I/O, GUI,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-136.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Networking, etc.&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE&amp;#45;&amp;gt;J2SE --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE-&gt;J2SE&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M81.67,-255.82C81.67,-242.99 81.67,-228.4 81.67,-214.79&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;85.17,-215.16 81.67,-205.16 78.17,-215.16 85.17,-215.16&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;107.53&quot; y=&quot;-225.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;builds on&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2ME --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2ME&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;163.34,-75.2 0,-75.2 0,0 163.34,0 163.34,-75.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-58.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2ME&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Micro)&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Mobile/embedded devices&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.67&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Restricted APIs&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2SE&amp;#45;&amp;gt;J2ME --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2SE-&gt;J2ME&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M81.67,-127.82C81.67,-114.99 81.67,-100.4 81.67,-86.79&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;85.17,-87.16 81.67,-77.16 78.17,-87.16 85.17,-87.16&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;112.19&quot; y=&quot;-97.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;superset of&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Hierarchical&lt;/strong&gt;: J2EE ⊃ J2SE ⊃ J2ME (conceptual superset)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2SE foundation&lt;/strong&gt;: All platforms build on standard Java core&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE barrier to entry&lt;/strong&gt;: Implementing J2EE is huge undertaking (includes all J2SE + enterprise APIs)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Industry consolidation&lt;/strong&gt;: High barrier led to few major J2EE players&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2ME restrictions&lt;/strong&gt;: Limited by device memory and processing power&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../j2ee-specification&quot; class=&quot;internal alias&quot; data-slug=&quot;j2ee-specification&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;J2EE Specification&lt;/a&gt; — J2EE is one platform&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../component-architecture-soa&quot; class=&quot;internal alias&quot; data-slug=&quot;component-architecture-soa&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Component Architecture&lt;/a&gt; — J2EE implements this&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — EJB is part of J2EE&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../j2ee-compliance&quot; class=&quot;internal alias&quot; data-slug=&quot;j2ee-compliance&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;J2EE Compliance&lt;/a&gt; — compliance applies to J2EE platform&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;“Conceptual superset”&lt;/strong&gt;: Not strict subset/superset in code terms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2SE in J2EE&lt;/strong&gt;: J2EE products must pass J2SE tests too&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern names&lt;/strong&gt;: J2ME → Java ME, J2SE → Java SE, J2EE → Java EE&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Android&lt;/strong&gt;: Not part of this hierarchy—uses different APIs&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>javamail</title>
    <link href="https://animishraa05.github.io/wiki/ejb/javamail" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/javamail.md" />
    <summary>The Problem J2EE applications often need to send email notifications (order confirmations, password resets, alerts).</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="email" label="email" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE applications often need to send email notifications (order confirmations, password resets, alerts). Without a standard API, developers must deal with vendor-specific email protocols (SMTP, POP3, IMAP) directly.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JavaMail enables sending email messages in a platform-independent, protocol-independent manner from Java programs. It depends on JavaBeans Activation Framework (JAF), which also becomes part of J2EE.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Protocol-independent&lt;/strong&gt;: Works with SMTP, POP3, IMAP without code changes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Session creation&lt;/strong&gt;: Obtain &lt;code class=&quot;notranslate&quot;&gt;javax.mail.Session&lt;/code&gt; (often via JNDI)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Message construction&lt;/strong&gt;: Create &lt;code class=&quot;notranslate&quot;&gt;MimeMessage&lt;/code&gt; with subject, body, recipients&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transport&lt;/strong&gt;: Use &lt;code class=&quot;notranslate&quot;&gt;Transport.send()&lt;/code&gt; to send the message&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE integration&lt;/strong&gt;: Use in servlets, JSP, or EJB components&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Example: Send order confirmation email from an e-commerce site.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;675pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 675.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 671.15,-94 671.15,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- J2EE App --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2EE App&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;73.16,-63 0,-63 0,-27 73.16,-27 73.16,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;36.58&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2EE App&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JavaMail API --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JavaMail API&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;260.51,-63 169.42,-45 260.51,-27 351.6,-45 260.51,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;260.51&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JavaMail API&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE App&amp;#45;&amp;gt;JavaMail API --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE App-&gt;JavaMail API&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M73.24,-45C95.73,-45 126.03,-45 155.66,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;155.45,-48.5 165.45,-45 155.45,-41.5 155.45,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;121.29&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;send email&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAF --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAF&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;524.28,-90 470.28,-90 470.28,-54 524.28,-54 524.28,-90&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;497.28&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JAF&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JavaMail API&amp;#45;&amp;gt;JAF --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JavaMail API-&gt;JAF&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M319.84,-51.71C363.22,-56.7 421.15,-63.36 458.59,-67.67&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;458.14,-71.14 468.47,-68.8 458.94,-64.18 458.14,-71.14&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;401.29&quot; y=&quot;-68.22&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;depends on&lt;/text&gt;
&lt;/g&gt;
&lt;!-- SMTP Server --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;SMTP Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M543.58,-32.73C543.58,-34.53 522.83,-36 497.28,-36 471.73,-36 450.97,-34.53 450.97,-32.73 450.97,-32.73 450.97,-3.27 450.97,-3.27 450.97,-1.47 471.73,0 497.28,0 522.83,0 543.58,-1.47 543.58,-3.27 543.58,-3.27 543.58,-32.73 543.58,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M543.58,-32.73C543.58,-30.92 522.83,-29.45 497.28,-29.45 471.73,-29.45 450.97,-30.92 450.97,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;497.28&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;SMTP Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JavaMail API&amp;#45;&amp;gt;SMTP Server --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JavaMail API-&gt;SMTP Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M319.84,-38.29C356.36,-34.09 403.19,-28.71 439.42,-24.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;439.75,-28.02 449.28,-23.4 438.95,-21.07 439.75,-28.02&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;401.29&quot; y=&quot;-36.51&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;SMTP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- User&amp;#39;s Inbox --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;User&#039;s Inbox&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;661.15,-36 580.58,-36 580.58,0 667.15,0 667.15,-30 661.15,-36&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;661.15,-36 661.15,-30&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;667.15,-30 661.15,-30&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;623.87&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;User&#039;s Inbox&lt;/text&gt;
&lt;/g&gt;
&lt;!-- SMTP Server&amp;#45;&amp;gt;User&amp;#39;s Inbox --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;SMTP Server-&gt;User&#039;s Inbox&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M543.96,-18C551.99,-18 560.41,-18 568.64,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;568.57,-21.5 578.57,-18 568.57,-14.5 568.57,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Platform-independent&lt;/strong&gt;: Works on any Java platform&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protocol-independent&lt;/strong&gt;: Supports SMTP, POP3, IMAP&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JAF dependency&lt;/strong&gt;: Requires JavaBeans Activation Framework&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server-side use&lt;/strong&gt;: Commonly used in J2EE deployments&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — JavaMail is part of J2EE&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — EJB components can use JavaMail&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../servlets&quot; class=&quot;internal alias&quot; data-slug=&quot;servlets&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Servlets&lt;/a&gt; — servlets commonly send emails&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jsp&quot; class=&quot;internal alias&quot; data-slug=&quot;jsp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JSP&lt;/a&gt; — JSP pages can trigger email sending&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;JAF required&lt;/strong&gt;: Forgetting JAF causes ClassNotFound errors&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SMTP configuration&lt;/strong&gt;: Must configure SMTP host correctly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: SMTP may require username/password&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Not covered&lt;/strong&gt;: The source book does not cover JavaMail in detail&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jax-rpc</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jax-rpc" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jax-rpc.md" />
    <summary>The Problem Java applications need to build and consume web services (SOAP-based) in a standardized way.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="web-services" label="web-services" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Java applications need to build and consume web services (SOAP-based) in a standardized way. Without a common API, each developer would implement SOAP/XML parsing differently, leading to interoperability issues.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JAX-RPC (Java API for XML RPC) is the main technology for developing web services on J2EE. It defines two endpoint models: one based on servlet technology and another based on EJB. It specifies runtime requirements for web service support in J2EE.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Endpoint models&lt;/strong&gt;: Servlet-based (easier) and EJB-based (full container services)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SOAP messaging&lt;/strong&gt;: JAX-RPC handles SOAP request/response serialization&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;WSDL support&lt;/strong&gt;: Generates and parses WSDL descriptions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deployment&lt;/strong&gt;: “Web Services for J2EE” spec defines deployment requirements using JAX-RPC programming model&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE integration&lt;/strong&gt;: Works with J2EE security, transactions, and lifecycle&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Chapter 5 of the source book discusses JAX-RPC support for EJB applications.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;729pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 729.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 724.94,-94 724.94,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M42,-63C42,-63 12,-63 12,-63 6,-63 0,-57 0,-51 0,-51 0,-39 0,-39 0,-33 6,-27 12,-27 12,-27 42,-27 42,-27 48,-27 54,-33 54,-39 54,-39 54,-51 54,-51 54,-57 48,-63 42,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client&lt;/text&gt;
&lt;/g&gt;
&lt;!-- SOAP Request --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;SOAP Request&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;219.4,-63 125,-63 125,-27 225.4,-27 225.4,-57 219.4,-63&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;219.4,-63 219.4,-57&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;225.4,-57 219.4,-57&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;175.2&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;SOAP Request&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;SOAP Request --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;SOAP Request&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M54.48,-45C70.93,-45 92.79,-45 113.33,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;113.05,-48.5 123.05,-45 113.05,-41.5 113.05,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;89.5&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTTP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAX&amp;#45;RPC Endpoint --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAX-RPC Endpoint&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;390.02,-63 262.4,-63 262.4,-27 390.02,-27 390.02,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;326.21&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JAX-RPC Endpoint&lt;/text&gt;
&lt;/g&gt;
&lt;!-- SOAP Request&amp;#45;&amp;gt;JAX&amp;#45;RPC Endpoint --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;SOAP Request-&gt;JAX-RPC Endpoint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M225.82,-45C233.79,-45 242.19,-45 250.6,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;250.51,-48.5 260.51,-45 250.51,-41.5 250.51,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Servlet Endpoint --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Servlet Endpoint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M570,-90C570,-90 483.51,-90 483.51,-90 477.51,-90 471.51,-84 471.51,-78 471.51,-78 471.51,-66 471.51,-66 471.51,-60 477.51,-54 483.51,-54 483.51,-54 570,-54 570,-54 576,-54 582,-60 582,-66 582,-66 582,-78 582,-78 582,-84 576,-90 570,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;526.76&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Servlet Endpoint&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAX&amp;#45;RPC Endpoint&amp;#45;&amp;gt;Servlet Endpoint --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAX-RPC Endpoint-&gt;Servlet Endpoint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M390.3,-53.58C412.55,-56.61 437.6,-60.01 460.06,-63.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;459.31,-66.5 469.69,-64.38 460.25,-59.56 459.31,-66.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;430.77&quot; y=&quot;-65.91&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;model 1&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Endpoint --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJB Endpoint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M561.84,-36C561.84,-36 491.67,-36 491.67,-36 485.67,-36 479.67,-30 479.67,-24 479.67,-24 479.67,-12 479.67,-12 479.67,-6 485.67,0 491.67,0 491.67,0 561.84,0 561.84,0 567.84,0 573.84,-6 573.84,-12 573.84,-12 573.84,-24 573.84,-24 573.84,-30 567.84,-36 561.84,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;526.76&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Endpoint&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAX&amp;#45;RPC Endpoint&amp;#45;&amp;gt;EJB Endpoint --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAX-RPC Endpoint-&gt;EJB Endpoint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M390.3,-36.42C415.2,-33.03 443.62,-29.17 467.97,-25.86&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;468.27,-29.35 477.71,-24.53 467.33,-22.41 468.27,-29.35&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;430.77&quot; y=&quot;-38.12&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;model 2&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Business Logic --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Business Logic&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M720.94,-32.73C720.94,-34.53 698.1,-36 669.97,-36 641.85,-36 619,-34.53 619,-32.73 619,-32.73 619,-3.27 619,-3.27 619,-1.47 641.85,0 669.97,0 698.1,0 720.94,-1.47 720.94,-3.27 720.94,-3.27 720.94,-32.73 720.94,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M720.94,-32.73C720.94,-30.92 698.1,-29.45 669.97,-29.45 641.85,-29.45 619,-30.92 619,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;669.97&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Business Logic&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Endpoint&amp;#45;&amp;gt;Business Logic --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB Endpoint-&gt;Business Logic&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M574,-18C584.62,-18 596.09,-18 607.25,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;607.22,-21.5 617.22,-18 607.22,-14.5 607.22,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;SOAP-based&lt;/strong&gt;: Uses SOAP protocol for XML RPC&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two endpoint models&lt;/strong&gt;: Servlet (simple) and EJB (full services)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE 1.4 specification&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;WSDL integration&lt;/strong&gt;: Works with WSDL service descriptions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Runtime requirements&lt;/strong&gt;: Specifies how containers must support web services&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — EJB endpoint model uses container services&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — JAX-RPC is part of J2EE&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../web-services&quot; class=&quot;internal alias&quot; data-slug=&quot;web-services&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Web Services&lt;/a&gt; — JAX-RPC enables web service development&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../rest&quot; class=&quot;internal alias&quot; data-slug=&quot;rest&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;REST&lt;/a&gt; — JAX-RPC is SOAP/XML, REST is simpler HTTP&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Deprecated&lt;/strong&gt;: JAX-RPC replaced by JAX-WS in modern Java EE&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SOAP complexity&lt;/strong&gt;: XML serialization has overhead&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EJB endpoint overhead&lt;/strong&gt;: Full container services may be unnecessary for simple services&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;em&gt;WS-&lt;/em&gt; standards&lt;/em&gt;*: Many additional specs beyond core JAX-RPC&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jaxp</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jaxp" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jaxp.md" />
    <summary>The Problem J2EE applications frequently need to parse XML documents (for B2B interactions, legacy system data mapping, or persisting XML to databases).</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="xml" label="xml" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;J2EE applications frequently need to parse XML documents (for B2B interactions, legacy system data mapping, or persisting XML to databases). Without a standard API, developers use different XML parsers inconsistently, leading to vendor lock-in and portability issues.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JAXP (Java API for XML Parsing) is the de facto API for parsing XML documents in J2EE applications. It’s implementation-neutral, working with various XML parsing technologies like DOM and SAX.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Implementation-neutral&lt;/strong&gt;: JAXP API works with any compliant parser (Xerces, Crimson, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DOM parsing&lt;/strong&gt;: Loads entire XML into memory as a tree (good for small docs, random access)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SAX parsing&lt;/strong&gt;: Event-based, reads XML sequentially (good for large docs, memory-efficient)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Used from&lt;/strong&gt;: Servlets, JSP, or EJB components&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Common use cases: B2B Web Services (SOAP uses XML), legacy data mapping, XML persistence.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;535pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 535.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 530.6,-94 530.6,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- J2EE Component --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2EE Component&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;114.38,-90 0,-90 0,-54 114.38,-54 114.38,-90&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;57.19&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2EE Component&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAXP API --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JAXP API&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;288.19,-63 214.53,-45 288.19,-27 361.86,-45 288.19,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;288.19&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JAXP API&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Component&amp;#45;&amp;gt;JAXP API --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE Component-&gt;JAXP API&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M114.8,-65.33C148.48,-61.36 191.22,-56.32 225.72,-52.25&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;226.05,-55.73 235.58,-51.09 225.23,-48.78 226.05,-55.73&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;164.46&quot; y=&quot;-66.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;parse XML&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DOM Parser --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DOM Parser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M514.6,-90C514.6,-90 451.45,-90 451.45,-90 445.45,-90 439.45,-84 439.45,-78 439.45,-78 439.45,-66 439.45,-66 439.45,-60 445.45,-54 451.45,-54 451.45,-54 514.6,-54 514.6,-54 520.6,-54 526.6,-60 526.6,-66 526.6,-66 526.6,-78 526.6,-78 526.6,-84 520.6,-90 514.6,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;483.03&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;DOM Parser&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAXP API&amp;#45;&amp;gt;DOM Parser --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAXP API-&gt;DOM Parser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M336.37,-51.6C364.03,-55.48 399.08,-60.39 427.86,-64.42&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;427.08,-67.84 437.46,-65.76 428.05,-60.91 427.08,-67.84&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;400.65&quot; y=&quot;-67.47&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;can use&lt;/text&gt;
&lt;/g&gt;
&lt;!-- SAX Parser --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;SAX Parser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M512.27,-36C512.27,-36 453.78,-36 453.78,-36 447.78,-36 441.78,-30 441.78,-24 441.78,-24 441.78,-12 441.78,-12 441.78,-6 447.78,0 453.78,0 453.78,0 512.27,0 512.27,0 518.27,0 524.27,-6 524.27,-12 524.27,-12 524.27,-24 524.27,-24 524.27,-30 518.27,-36 512.27,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;483.03&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;SAX Parser&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JAXP API&amp;#45;&amp;gt;SAX Parser --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JAXP API-&gt;SAX Parser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M336.37,-38.4C364.81,-34.41 401.08,-29.33 430.31,-25.24&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;430.62,-28.73 440.04,-23.88 429.65,-21.8 430.62,-28.73&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;400.65&quot; y=&quot;-35.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;can use&lt;/text&gt;
&lt;/g&gt;
&lt;!-- XML Document --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;XML Document&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;105.66,-36 2.73,-36 2.73,0 111.66,0 111.66,-30 105.66,-36&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;105.66,-36 105.66,-30&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;111.66,-30 105.66,-30&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;57.19&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;XML Document&lt;/text&gt;
&lt;/g&gt;
&lt;!-- XML Document&amp;#45;&amp;gt;JAXP API --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;XML Document-&gt;JAXP API&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M111.88,-24.33C146,-28.35 190.26,-33.57 225.78,-37.76&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;225.13,-41.21 235.47,-38.9 225.95,-34.26 225.13,-41.21&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;164.46&quot; y=&quot;-38.12&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;input&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Implementation-neutral&lt;/strong&gt;: Switch parsers without changing code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DOM support&lt;/strong&gt;: Tree-based parsing for random access&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SAX support&lt;/strong&gt;: Event-based parsing for large documents&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Widely used&lt;/strong&gt;: SOAP, B2B, XML persistence all use JAXP&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — JAXP is part of J2EE&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jax-rpc&quot; class=&quot;internal alias&quot; data-slug=&quot;jax-rpc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JAX-RPC&lt;/a&gt; — JAX-RPC uses XML/SOAP (parsed by JAXP)&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../web-services&quot; class=&quot;internal alias&quot; data-slug=&quot;web-services&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Web Services&lt;/a&gt; — XML parsing is core to web services&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — EJB components can use JAXP&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;DOM memory&lt;/strong&gt;: Large XML docs can cause OutOfMemoryError with DOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SAX complexity&lt;/strong&gt;: Event-based model is harder to program&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parser configuration&lt;/strong&gt;: Must ensure correct parser is on classpath&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Namespace support&lt;/strong&gt;: Proper namespace handling requires care&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jca</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jca" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jca.md" />
    <summary>The Problem Enterprises have existing systems (mainframes with CICS/TUXEDO, ERP systems like SAP/Siebel, proprietary systems) that J2EE applications need to access.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="integration" label="integration" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Enterprises have existing systems (mainframes with CICS/TUXEDO, ERP systems like SAP/Siebel, proprietary systems) that J2EE applications need to access. Without a standard way to connect, each vendor writes custom, incompatible integrations, leading to maintenance nightmares.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JCA (J2EE Connector Architecture) enables J2EE applications to access existing enterprise information systems (EIS) through standard resource adapters. Write once, deploy to any J2EE-compliant server. Handles transactions, security, lifecycle, and thread management automatically.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Resource Adapter&lt;/strong&gt;: JCA-compliant adapter for the EIS (like SAP adapter)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;System Contracts&lt;/strong&gt;: Adapter implements contracts for connection management, transaction management, and security&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application&lt;/strong&gt;: Uses standard J2EE APIs to call the adapter&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container manages&lt;/strong&gt;: Transactions, security, lifecycle, threading handled by container&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Portable&lt;/strong&gt;: Deploy same adapter to any J2EE-compliant server&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Chapter 17 discusses legacy integration in more detail.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;749pt&quot; height=&quot;152pt&quot; viewBox=&quot;0.00 0.00 749.00 152.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 148)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-148 744.86,-148 744.86,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- J2EE App --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2EE App&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;88.71,-117 15.55,-117 15.55,-81 88.71,-81 88.71,-117&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;52.13&quot; y=&quot;-94.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2EE App&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JCA Resource Adapter --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JCA Resource Adapter&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;355.27,-90 213.75,-72 355.27,-54 496.79,-72 355.27,-90&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;355.27&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JCA Resource Adapter&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE App&amp;#45;&amp;gt;JCA Resource Adapter --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE App-&gt;JCA Resource Adapter&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M89.15,-95.77C130.72,-92.04 200.75,-85.76 258.4,-80.6&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;258.59,-84.09 268.24,-79.71 257.97,-77.12 258.59,-84.09&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;159&quot; y=&quot;-96.68&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;standard API&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Mainframe (CICS) --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Mainframe (CICS)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M740.07,-140.73C740.07,-142.53 712.7,-144 679,-144 645.31,-144 617.93,-142.53 617.93,-140.73 617.93,-140.73 617.93,-111.27 617.93,-111.27 617.93,-109.47 645.31,-108 679,-108 712.7,-108 740.07,-109.47 740.07,-111.27 740.07,-111.27 740.07,-140.73 740.07,-140.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M740.07,-140.73C740.07,-138.92 712.7,-137.45 679,-137.45 645.31,-137.45 617.93,-138.92 617.93,-140.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;679&quot; y=&quot;-121.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Mainframe (CICS)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JCA Resource Adapter&amp;#45;&amp;gt;Mainframe (CICS) --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JCA Resource Adapter-&gt;Mainframe (CICS)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M418.3,-82.41C472.03,-91.43 549.77,-104.48 606.18,-113.95&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;605.59,-117.39 616.03,-115.6 606.75,-110.49 605.59,-117.39&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;556.97&quot; y=&quot;-115.72&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;native protocol&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ERP (SAP) --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ERP (SAP)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M719.1,-86.73C719.1,-88.53 701.13,-90 679,-90 656.88,-90 638.91,-88.53 638.91,-86.73 638.91,-86.73 638.91,-57.27 638.91,-57.27 638.91,-55.47 656.88,-54 679,-54 701.13,-54 719.1,-55.47 719.1,-57.27 719.1,-57.27 719.1,-86.73 719.1,-86.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M719.1,-86.73C719.1,-84.92 701.13,-83.45 679,-83.45 656.88,-83.45 638.91,-84.92 638.91,-86.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;679&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ERP (SAP)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JCA Resource Adapter&amp;#45;&amp;gt;ERP (SAP) --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JCA Resource Adapter-&gt;ERP (SAP)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M500.67,-72C545.99,-72 593.08,-72 627.33,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;626.92,-75.5 636.92,-72 626.92,-68.5 626.92,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;556.97&quot; y=&quot;-76.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;native protocol&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Proprietary System --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Proprietary System&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M740.86,-32.73C740.86,-34.53 713.13,-36 679,-36 644.87,-36 617.15,-34.53 617.15,-32.73 617.15,-32.73 617.15,-3.27 617.15,-3.27 617.15,-1.47 644.87,0 679,0 713.13,0 740.86,-1.47 740.86,-3.27 740.86,-3.27 740.86,-32.73 740.86,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M740.86,-32.73C740.86,-30.92 713.13,-29.45 679,-29.45 644.87,-29.45 617.15,-30.92 617.15,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;679&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Proprietary System&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JCA Resource Adapter&amp;#45;&amp;gt;Proprietary System --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JCA Resource Adapter-&gt;Proprietary System&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M418.3,-61.59C471.77,-52.61 549.03,-39.65 605.37,-30.19&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;605.93,-33.65 615.21,-28.54 604.77,-26.74 605.93,-33.65&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;556.97&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;native protocol&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Container --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;J2EE Container&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;104.26,-63 0,-63 0,-27 104.26,-27 104.26,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;52.13&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;J2EE Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- J2EE Container&amp;#45;&amp;gt;JCA Resource Adapter --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;J2EE Container-&gt;JCA Resource Adapter&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M104.55,-49.61C146.64,-53.38 207.34,-58.83 258.35,-63.4&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;257.97,-66.88 268.24,-64.29 258.59,-59.91 257.97,-66.88&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;159&quot; y=&quot;-61.89&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;manages&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Write once, run anywhere&lt;/strong&gt;: Single adapter works on all J2EE servers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container-managed&lt;/strong&gt;: Transactions, security, lifecycle handled by container&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ISV benefit&lt;/strong&gt;: Independent Software Vendors (SAP, Siebel) write one adapter&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standard contracts&lt;/strong&gt;: Connection, transaction, security contracts defined by JCA spec&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Legacy integration&lt;/strong&gt;: Bridges modern J2EE with legacy systems&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — container manages JCA adapters&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — JCA is part of J2EE&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../message-driven-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;message-driven-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Message-Driven Bean&lt;/a&gt; — JCA 1.5+ supports MDB for non-JMS messages&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt; — JCA is middleware for legacy integration&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Adapter quality&lt;/strong&gt;: Poorly written adapters can cause issues&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transaction propagation&lt;/strong&gt;: XA transactions across EIS systems can be complex&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connection pooling&lt;/strong&gt;: Adapter must properly implement connection management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JCA versions&lt;/strong&gt;: JCA 1.5 added Message Inflow (for MDBs)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jndi-architecture</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jndi-architecture" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jndi-architecture.md" />
    <summary>The Problem Java applications need to access different naming and directory services (LDAP, NIS, Novell NDS), but each has its own protocol and API.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Java applications need to access different naming and directory services (LDAP, NIS, Novell NDS), but each has its own protocol and API. Learning and coding to multiple vendor-specific APIs is complex and creates vendor lock-in. How can we provide a single, unified interface?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JNDI has a two-part architecture: the Client API (for application developers) and the Service Provider Interface or SPI (for vendor implementations). The Client API provides a uniform interface for all directory operations, while the SPI allows vendors to plug in their specific protocols behind a common interface.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Client API layer&lt;/strong&gt;: Application code uses &lt;code class=&quot;notranslate&quot;&gt;javax.naming&lt;/code&gt; classes (&lt;code class=&quot;notranslate&quot;&gt;InitialContext&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;Context&lt;/code&gt;) to perform lookups, bindings, and searches&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SPI layer&lt;/strong&gt;: Vendors implement &lt;code class=&quot;notranslate&quot;&gt;javax.naming.spi&lt;/code&gt; interfaces to bridge JNDI calls to their specific protocols&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service Providers&lt;/strong&gt;: LDAP provider maps JNDI calls to LDAP protocol; NIS provider maps to NIS protocol, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pluggable architecture&lt;/strong&gt;: Swap providers without changing application code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE integration&lt;/strong&gt;: J2EE servers bundle custom JNDI implementations, often fault-tolerant and integrated with other services (RMI-IIOP, JDBC, JMS)&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Analogous to JDBC: Client API = JDBC API; SPI = JDBC Drivers.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;686pt&quot; height=&quot;406pt&quot; viewBox=&quot;0.00 0.00 686.00 406.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 402.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-402.2 681.65,-402.2 681.65,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_jndi&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;257.72,-153.8 257.72,-319.4 383.72,-319.4 383.72,-153.8 257.72,-153.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;320.72&quot; y=&quot;-302.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client Code --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client Code&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;362.35,-398.2 279.08,-398.2 279.08,-362.2 362.35,-362.2 362.35,-398.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;320.72&quot; y=&quot;-376&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client Code&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI Client API --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JNDI Client API&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;375.77,-286.6 265.66,-286.6 265.66,-250.6 375.77,-250.6 375.77,-286.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;320.72&quot; y=&quot;-264.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI Client API&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client Code&amp;#45;&amp;gt;JNDI Client API --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client Code-&gt;JNDI Client API&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M320.72,-362.07C320.72,-345.04 320.72,-318.6 320.72,-298.35&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;324.22,-298.48 320.72,-288.48 317.22,-298.48 324.22,-298.48&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;365.43&quot; y=&quot;-331.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;lookup(), bind()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JNDI SPI&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;344.75,-197.8 274.68,-197.8 274.68,-161.8 344.75,-161.8 344.75,-197.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;309.72&quot; y=&quot;-175.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI SPI&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI Client API&amp;#45;&amp;gt;JNDI SPI --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI Client API-&gt;JNDI SPI&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M318.54,-250.45C317.06,-238.76 315.06,-222.99 313.34,-209.42&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;316.84,-209.19 312.11,-199.71 309.9,-210.07 316.84,-209.19&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;349.44&quot; y=&quot;-220&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;delegates to&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP Provider --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LDAP Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M89.9,-106.91C89.9,-106.91 11.82,-93.09 11.82,-93.09 5.91,-92.05 5.91,-89.95 11.82,-88.91 11.82,-88.91 89.9,-75.09 89.9,-75.09 95.81,-74.05 107.63,-74.05 113.53,-75.09 113.53,-75.09 191.62,-88.91 191.62,-88.91 197.53,-89.95 197.53,-92.05 191.62,-93.09 191.62,-93.09 113.53,-106.91 113.53,-106.91 107.63,-107.95 95.81,-107.95 89.9,-106.91&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;101.72&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LDAP Provider&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI&amp;#45;&amp;gt;LDAP Provider --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI SPI-&gt;LDAP Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M274.43,-164.08C237.56,-148.69 179.84,-124.6 141.41,-108.56&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;143.09,-105.47 132.51,-104.85 140.39,-111.93 143.09,-105.47&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;242.24&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;plugin&lt;/text&gt;
&lt;/g&gt;
&lt;!-- NIS Provider --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;NIS Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M297.96,-106.6C297.96,-106.6 233.41,-93.4 233.41,-93.4 227.54,-92.2 227.54,-89.8 233.41,-88.6 233.41,-88.6 297.96,-75.4 297.96,-75.4 303.84,-74.2 315.6,-74.2 321.47,-75.4 321.47,-75.4 386.02,-88.6 386.02,-88.6 391.9,-89.8 391.9,-92.2 386.02,-93.4 386.02,-93.4 321.47,-106.6 321.47,-106.6 315.6,-107.8 303.84,-107.8 297.96,-106.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;309.72&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NIS Provider&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI&amp;#45;&amp;gt;NIS Provider --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI SPI-&gt;NIS Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M309.72,-161.65C309.72,-149.96 309.72,-134.19 309.72,-120.62&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;313.22,-120.92 309.72,-110.92 306.22,-120.92 313.22,-120.92&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;327.61&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;plugin&lt;/text&gt;
&lt;/g&gt;
&lt;!-- File System Provider --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;File System Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M534.83,-107.37C534.83,-107.37 427.67,-92.63 427.67,-92.63 421.73,-91.82 421.73,-90.18 427.67,-89.37 427.67,-89.37 534.83,-74.63 534.83,-74.63 540.77,-73.82 552.66,-73.82 558.61,-74.63 558.61,-74.63 665.76,-89.37 665.76,-89.37 671.71,-90.18 671.71,-91.82 665.76,-92.63 665.76,-92.63 558.61,-107.37 558.61,-107.37 552.66,-108.18 540.77,-108.18 534.83,-107.37&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;546.72&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;File System Provider&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI&amp;#45;&amp;gt;File System Provider --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI SPI-&gt;File System Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M345.2,-165.81C386.83,-150.56 455.94,-125.25 501.41,-108.59&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;502.54,-111.91 510.73,-105.18 500.14,-105.33 502.54,-111.91&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;467.33&quot; y=&quot;-131.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;plugin&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP Server --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LDAP Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M148.02,-32.73C148.02,-34.53 127.26,-36 101.72,-36 76.17,-36 55.42,-34.53 55.42,-32.73 55.42,-32.73 55.42,-3.27 55.42,-3.27 55.42,-1.47 76.17,0 101.72,0 127.26,0 148.02,-1.47 148.02,-3.27 148.02,-3.27 148.02,-32.73 148.02,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M148.02,-32.73C148.02,-30.92 127.26,-29.45 101.72,-29.45 76.17,-29.45 55.42,-30.92 55.42,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;101.72&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LDAP Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP Provider&amp;#45;&amp;gt;LDAP Server --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;LDAP Provider-&gt;LDAP Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M101.72,-72.81C101.72,-65.23 101.72,-56.1 101.72,-47.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;105.22,-47.54 101.72,-37.54 98.22,-47.54 105.22,-47.54&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- NIS Server --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;NIS Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M349.02,-32.73C349.02,-34.53 331.4,-36 309.72,-36 288.03,-36 270.42,-34.53 270.42,-32.73 270.42,-32.73 270.42,-3.27 270.42,-3.27 270.42,-1.47 288.03,0 309.72,0 331.4,0 349.02,-1.47 349.02,-3.27 349.02,-3.27 349.02,-32.73 349.02,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M349.02,-32.73C349.02,-30.92 331.4,-29.45 309.72,-29.45 288.03,-29.45 270.42,-30.92 270.42,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;309.72&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NIS Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- NIS Provider&amp;#45;&amp;gt;NIS Server --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;NIS Provider-&gt;NIS Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M309.72,-72.81C309.72,-65.23 309.72,-56.1 309.72,-47.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;313.22,-47.54 309.72,-37.54 306.22,-47.54 313.22,-47.54&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Local FS --&gt;
&lt;g id=&quot;node9&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Local FS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M580.19,-32.73C580.19,-34.53 565.19,-36 546.72,-36 528.25,-36 513.25,-34.53 513.25,-32.73 513.25,-32.73 513.25,-3.27 513.25,-3.27 513.25,-1.47 528.25,0 546.72,0 565.19,0 580.19,-1.47 580.19,-3.27 580.19,-3.27 580.19,-32.73 580.19,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M580.19,-32.73C580.19,-30.92 565.19,-29.45 546.72,-29.45 528.25,-29.45 513.25,-30.92 513.25,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;546.72&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Local FS&lt;/text&gt;
&lt;/g&gt;
&lt;!-- File System Provider&amp;#45;&amp;gt;Local FS --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;File System Provider-&gt;Local FS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M546.72,-72.81C546.72,-65.23 546.72,-56.1 546.72,-47.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;550.22,-47.54 546.72,-37.54 543.22,-47.54 550.22,-47.54&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Unified API&lt;/strong&gt;: Single API for all directory types (LDAP, NIS, NDS, filesystem)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protocol insulation&lt;/strong&gt;: Application code doesn’t know or care about underlying protocol&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pluggable providers&lt;/strong&gt;: Vendors implement SPI to support their directory service&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Federated directories&lt;/strong&gt;: Combine multiple directories (LDAP + NDS) into one logical view&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Portable&lt;/strong&gt;: Code works across different JNDI implementations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE integration&lt;/strong&gt;: Used for EJB lookups, DataSource lookups, JMS connection factories&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; — JNDI is the naming service this architecture implements&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-naming-service&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-naming-service&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Naming Service&lt;/a&gt; — EJB uses JNDI for bean lookups&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../rmi-remote-method-invocation&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-remote-method-invocation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI&lt;/a&gt; — RMI Registry is narrower, JNDI is broader&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt; — similar API/driver architecture pattern&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../location-transparency&quot; class=&quot;internal alias&quot; data-slug=&quot;location-transparency&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Location Transparency&lt;/a&gt; — JNDI enables location-independent lookups&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — containers provide JNDI implementations&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Provider not found&lt;/strong&gt;: If the service provider class isn’t on classpath, lookups fail&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Different JNDI trees&lt;/strong&gt;: Each server vendor may use different JNDI naming conventions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;: JNDI lookups have overhead; cache references when possible&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Federated directories&lt;/strong&gt;: Can be complex to configure and debug&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;InitialContext&lt;/strong&gt;: Must be configured with correct environment properties for the provider&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jndi-binding</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jndi-binding" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jndi-binding.md" />
    <summary>The Problem In a naming system, we need to associate names with objects so clients can look them up.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;In a naming system, we need to associate names with objects so clients can look them up. How do we represent the association between a name (like &lt;code class=&quot;notranslate&quot;&gt;autoexec.bat&lt;/code&gt;) and the actual object it refers to (the file data on disk)?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A binding is an association of a name with an object. For example, &lt;code class=&quot;notranslate&quot;&gt;autoexec.bat&lt;/code&gt; is bound to the file data on your hard disk. In JNDI, bindings are the fundamental associations that make up contexts—each context contains a set of bindings.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;A binding maps a name (atomic name) to an object&lt;/li&gt;
&lt;li&gt;In file system: &lt;code class=&quot;notranslate&quot;&gt;autoexec.bat&lt;/code&gt; → file data on disk&lt;/li&gt;
&lt;li&gt;In JNDI: &lt;code class=&quot;notranslate&quot;&gt;MyBean&lt;/code&gt; → EJB Home Object reference&lt;/li&gt;
&lt;li&gt;A compound name like &lt;code class=&quot;notranslate&quot;&gt;/usr/people/ed/.cshrc&lt;/code&gt; consists of multiple bindings resolved sequentially&lt;/li&gt;
&lt;li&gt;Bindings are created with &lt;code class=&quot;notranslate&quot;&gt;Context.bind(name, obj)&lt;/code&gt; and looked up with &lt;code class=&quot;notranslate&quot;&gt;Context.lookup(name)&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;396pt&quot; height=&quot;140pt&quot; viewBox=&quot;0.00 0.00 396.00 140.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 136.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-136.2 392.09,-136.2 392.09,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Context: /etc --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Context: /etc&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;87.93,-79.6 0,-79.6 0,-43.6 87.93,-43.6 87.93,-79.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;43.96&quot; y=&quot;-57.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Context: /etc&lt;/text&gt;
&lt;/g&gt;
&lt;!-- mtab --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;mtab&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M248.45,-116.6C248.45,-116.6 185.32,-116.6 185.32,-116.6 179.32,-116.6 173.32,-110.6 173.32,-104.6 173.32,-104.6 173.32,-92.6 173.32,-92.6 173.32,-86.6 179.32,-80.6 185.32,-80.6 185.32,-80.6 248.45,-80.6 248.45,-80.6 254.45,-80.6 260.45,-86.6 260.45,-92.6 260.45,-92.6 260.45,-104.6 260.45,-104.6 260.45,-110.6 254.45,-116.6 248.45,-116.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;216.88&quot; y=&quot;-94.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;mtab (name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Context: /etc&amp;#45;&amp;gt;mtab --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Context: /etc-&gt;mtab&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M88.09,-70.94C110.55,-75.8 138.22,-81.79 162.06,-86.95&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;161.07,-90.32 171.59,-89.01 162.55,-83.47 161.07,-90.32&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;127.32&quot; y=&quot;-87.61&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- exports --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;exports&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M255.06,-52.6C255.06,-52.6 178.71,-52.6 178.71,-52.6 172.71,-52.6 166.71,-46.6 166.71,-40.6 166.71,-40.6 166.71,-28.6 166.71,-28.6 166.71,-22.6 172.71,-16.6 178.71,-16.6 178.71,-16.6 255.06,-16.6 255.06,-16.6 261.06,-16.6 267.06,-22.6 267.06,-28.6 267.06,-28.6 267.06,-40.6 267.06,-40.6 267.06,-46.6 261.06,-52.6 255.06,-52.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;216.88&quot; y=&quot;-30.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;exports (name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Context: /etc&amp;#45;&amp;gt;exports --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Context: /etc-&gt;exports&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M88.41,-49.48C94.27,-48.1 100.22,-46.82 105.93,-45.8 121.73,-42.96 138.96,-40.79 154.98,-39.14&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;155.28,-42.62 164.89,-38.18 154.6,-35.66 155.28,-42.62&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;127.32&quot; y=&quot;-50&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- mtab_file --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;mtab_file&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M381.48,-127C381.48,-129.87 365.61,-132.2 346.08,-132.2 326.54,-132.2 310.67,-129.87 310.67,-127 310.67,-127 310.67,-80.2 310.67,-80.2 310.67,-77.33 326.54,-75 346.08,-75 365.61,-75 381.48,-77.33 381.48,-80.2 381.48,-80.2 381.48,-127 381.48,-127&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M381.48,-127C381.48,-124.13 365.61,-121.8 346.08,-121.8 326.54,-121.8 310.67,-124.13 310.67,-127&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;346.08&quot; y=&quot;-107.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;mtab data&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;346.08&quot; y=&quot;-91&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(object)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- mtab&amp;#45;&amp;gt;mtab_file --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;mtab-&gt;mtab_file&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M260.95,-100.29C273.31,-100.78 286.83,-101.31 299.34,-101.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;298.85,-105.29 308.98,-102.18 299.12,-98.29 298.85,-105.29&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- exports_file --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;exports_file&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M388.09,-52C388.09,-54.87 369.26,-57.2 346.08,-57.2 322.89,-57.2 304.06,-54.87 304.06,-52 304.06,-52 304.06,-5.2 304.06,-5.2 304.06,-2.33 322.89,0 346.08,0 369.26,0 388.09,-2.33 388.09,-5.2 388.09,-5.2 388.09,-52 388.09,-52&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M388.09,-52C388.09,-49.13 369.26,-46.8 346.08,-46.8 322.89,-46.8 304.06,-49.13 304.06,-52&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;346.08&quot; y=&quot;-32.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;exports data&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;346.08&quot; y=&quot;-16&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(object)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- exports&amp;#45;&amp;gt;exports_file --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;exports-&gt;exports_file&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M267.43,-32.26C275.58,-31.88 284.06,-31.48 292.29,-31.09&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;292.36,-34.59 302.19,-30.62 292.03,-27.6 292.36,-34.59&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Name → Object&lt;/strong&gt;: The core association in naming systems&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Atomic name key&lt;/strong&gt;: Bindings are keyed by atomic names within a context&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mutable&lt;/strong&gt;: Bindings can be added, removed, or changed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type-independent&lt;/strong&gt;: The bound object can be any Java object&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Serializable&lt;/strong&gt;: Objects bound in JNDI should typically be serializable&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../atomic-name&quot; class=&quot;internal alias&quot; data-slug=&quot;atomic-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Atomic Name&lt;/a&gt; — bindings use atomic names as keys&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jndi-context&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Context&lt;/a&gt; — contexts contain bindings&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../compound-name&quot; class=&quot;internal alias&quot; data-slug=&quot;compound-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compound Name&lt;/a&gt; — compound names resolve through multiple bindings&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi-naming-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-naming-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Naming Concepts&lt;/a&gt; — bindings are a core concept&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; — JNDI provides the API for managing bindings&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Overwriting bindings&lt;/strong&gt;: Rebinding a name replaces the existing binding&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Null bindings&lt;/strong&gt;: Binding null may be allowed or may throw exception&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Object serialization&lt;/strong&gt;: Bound objects must be serializable for some providers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Garbage collection&lt;/strong&gt;: Binding keeps a reference to the object (prevents GC)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jndi-context</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jndi-context" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jndi-context.md" />
    <summary>The Problem In a hierarchical naming system, we need containers that group related name-to-object associations together.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;In a hierarchical naming system, we need containers that group related name-to-object associations together. How do we represent a “folder” in the naming tree that contains multiple bindings?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A context is a set of zero or more bindings, where each binding has a distinct atomic name. In the UNIX file system, a folder like &lt;code class=&quot;notranslate&quot;&gt;/etc&lt;/code&gt; is a context containing bindings to files like &lt;code class=&quot;notranslate&quot;&gt;mtab&lt;/code&gt; and &lt;code class=&quot;notranslate&quot;&gt;exports&lt;/code&gt;. Each context is also a subcontext of its parent.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Context implements &lt;code class=&quot;notranslate&quot;&gt;javax.naming.Context&lt;/code&gt; interface&lt;/li&gt;
&lt;li&gt;Contains bindings: name → object mappings&lt;/li&gt;
&lt;li&gt;Operations: &lt;code class=&quot;notranslate&quot;&gt;lookup(name)&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;bind(name, obj)&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;unbind(name)&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;list()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Subcontext: A context within a context (like &lt;code class=&quot;notranslate&quot;&gt;/usr/people&lt;/code&gt; within &lt;code class=&quot;notranslate&quot;&gt;/usr&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Each subcontext is a full context itself, capable of containing more bindings&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;In JNDI, the root context is obtained via &lt;code class=&quot;notranslate&quot;&gt;new InitialContext()&lt;/code&gt;. Subcontexts are created with &lt;code class=&quot;notranslate&quot;&gt;createSubcontext()&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;302pt&quot; height=&quot;223pt&quot; viewBox=&quot;0.00 0.00 302.00 223.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 218.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-218.6 297.98,-218.6 297.98,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Context: /usr --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Context: /usr&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;181.82,-214.6 112.16,-214.6 112.16,-173 181.82,-173 181.82,-214.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;146.99&quot; y=&quot;-198&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;/usr&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;146.99&quot; y=&quot;-181.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Context)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- people --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;people&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;85.98,-120.2 0,-120.2 0,-78.6 85.98,-78.6 85.98,-120.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;42.99&quot; y=&quot;-103.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;people&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;42.99&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(subcontext)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Context: /usr&amp;#45;&amp;gt;people --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Context: /usr-&gt;people&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M121.43,-172.77C114.45,-167.14 106.96,-160.93 100.21,-155 90.67,-146.62 80.56,-137.17 71.53,-128.52&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;73.98,-126.01 64.35,-121.58 69.11,-131.05 73.98,-126.01&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;121.6&quot; y=&quot;-142.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- bin --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;bin&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;189.98,-120.2 104,-120.2 104,-78.6 189.98,-78.6 189.98,-120.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;146.99&quot; y=&quot;-103.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;bin&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;146.99&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(subcontext)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Context: /usr&amp;#45;&amp;gt;bin --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Context: /usr-&gt;bin&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M146.99,-172.75C146.99,-160.76 146.99,-145.27 146.99,-131.7&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;150.49,-131.92 146.99,-121.92 143.49,-131.92 150.49,-131.92&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;168.38&quot; y=&quot;-142.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- local --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;local&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;293.98,-120.2 208,-120.2 208,-78.6 293.98,-78.6 293.98,-120.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;250.99&quot; y=&quot;-103.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;local&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;250.99&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(subcontext)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Context: /usr&amp;#45;&amp;gt;local --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Context: /usr-&gt;local&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M172.69,-172.79C179.7,-167.16 187.22,-160.94 193.99,-155 203.51,-146.64 213.59,-137.2 222.58,-128.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;224.99,-131.08 229.73,-121.61 220.11,-126.06 224.99,-131.08&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;233.03&quot; y=&quot;-142.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Context: /usr/people --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Context: /usr/people&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;85.98,-41.6 0,-41.6 0,0 85.98,0 85.98,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;42.99&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;/usr/people&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;42.99&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(subcontext)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- people&amp;#45;&amp;gt;Context: /usr/people --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;people-&gt;Context: /usr/people&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M42.99,-78.27C42.99,-70.68 42.99,-61.85 42.99,-53.46&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;46.49,-53.57 42.99,-43.57 39.49,-53.57 46.49,-53.57&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Container of bindings&lt;/strong&gt;: Groups related name→object associations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hierarchical&lt;/strong&gt;: Can contain subcontexts, forming a tree&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context operations&lt;/strong&gt;: lookup, bind, unbind, rename, list, createSubcontext&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;InitialContext&lt;/strong&gt;: The entry point for JNDI operations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Serializable&lt;/strong&gt;: Contexts can be bound into other contexts&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jndi-binding&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-binding&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Binding&lt;/a&gt; — contexts contain bindings&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jndi-naming-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-naming-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Naming Concepts&lt;/a&gt; — contexts are central to JNDI&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../subcontext&quot; class=&quot;internal alias&quot; data-slug=&quot;subcontext&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Subcontext&lt;/a&gt; — a context within a context&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; — JNDI provides the Context API&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../atomic-name&quot; class=&quot;internal alias&quot; data-slug=&quot;atomic-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Atomic Name&lt;/a&gt; — bindings in a context have atomic names&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Closing contexts&lt;/strong&gt;: Always close contexts to free resources&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Concurrent access&lt;/strong&gt;: Context operations may not be thread-safe&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lazy loading&lt;/strong&gt;: Large contexts may not load all bindings immediately&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context destruction&lt;/strong&gt;: Destroying a context may not recursively destroy subcontexts&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jndi-naming-concepts</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jndi-naming-concepts" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jndi-naming-concepts.md" />
    <summary>The Problem JNDI organizes names and objects in a tree structure similar to a file system.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JNDI organizes names and objects in a tree structure similar to a file system. Without understanding the fundamental naming concepts (atomic names, compound names, bindings, contexts), developers cannot effectively navigate or manipulate the JNDI directory tree.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JNDI uses a hierarchical naming model with five key concepts: atomic names (indivisible), compound names (combinations), bindings (name→object associations), contexts (sets of bindings), and subcontexts (contexts within contexts). This mirrors the file system model.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Atomic Name&lt;/strong&gt;: A simple, indivisible name (e.g., &lt;code class=&quot;notranslate&quot;&gt;etc&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;fstab&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;usr&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compound Name&lt;/strong&gt;: Multiple atomic names combined with syntax (&lt;code class=&quot;notranslate&quot;&gt;/etc/fstab&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;/usr/bin&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Binding&lt;/strong&gt;: Association of a name with an object (&lt;code class=&quot;notranslate&quot;&gt;autoexec.bat&lt;/code&gt; → file data)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context&lt;/strong&gt;: A set of bindings with distinct atomic names (&lt;code class=&quot;notranslate&quot;&gt;/etc&lt;/code&gt; contains &lt;code class=&quot;notranslate&quot;&gt;mtab&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;exports&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Subcontext&lt;/strong&gt;: A context within a context (&lt;code class=&quot;notranslate&quot;&gt;/usr/people&lt;/code&gt; is a subcontext of &lt;code class=&quot;notranslate&quot;&gt;/usr&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;A compound name like &lt;code class=&quot;notranslate&quot;&gt;/usr/people/ed/.cshrc&lt;/code&gt; represents multiple bindings resolved sequentially through the tree.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;676pt&quot; height=&quot;405pt&quot; viewBox=&quot;0.00 0.00 676.00 405.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 400.8)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-400.8 672.44,-400.8 672.44,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Root Context (/) --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Root Context (/)&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M392.91,-394C392.91,-394 309.14,-394 309.14,-394 303.14,-394 297.14,-388 297.14,-382 297.14,-382 297.14,-370 297.14,-370 297.14,-364 303.14,-358 309.14,-358 309.14,-358 392.91,-358 392.91,-358 398.91,-358 404.91,-364 404.91,-370 404.91,-370 404.91,-382 404.91,-382 404.91,-388 398.91,-394 392.91,-394&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;351.03&quot; y=&quot;-371.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Root Context (/)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- usr --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;usr&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M330.95,-302.4C330.95,-302.4 237.1,-302.4 237.1,-302.4 231.1,-302.4 225.1,-296.4 225.1,-290.4 225.1,-290.4 225.1,-278.4 225.1,-278.4 225.1,-272.4 231.1,-266.4 237.1,-266.4 237.1,-266.4 330.95,-266.4 330.95,-266.4 336.95,-266.4 342.95,-272.4 342.95,-278.4 342.95,-278.4 342.95,-290.4 342.95,-290.4 342.95,-296.4 336.95,-302.4 330.95,-302.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;284.03&quot; y=&quot;-280.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;usr (atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root Context (/)&amp;#45;&amp;gt;usr --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Root Context (/)-&gt;usr&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M338.11,-357.72C328.38,-344.71 314.86,-326.63 303.78,-311.81&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;306.6,-309.75 297.81,-303.83 301,-313.94 306.6,-309.75&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;342.93&quot; y=&quot;-324.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- etc --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;etc&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M534.56,-302.4C534.56,-302.4 441.5,-302.4 441.5,-302.4 435.5,-302.4 429.5,-296.4 429.5,-290.4 429.5,-290.4 429.5,-278.4 429.5,-278.4 429.5,-272.4 435.5,-266.4 441.5,-266.4 441.5,-266.4 534.56,-266.4 534.56,-266.4 540.56,-266.4 546.56,-272.4 546.56,-278.4 546.56,-278.4 546.56,-290.4 546.56,-290.4 546.56,-296.4 540.56,-302.4 534.56,-302.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;488.03&quot; y=&quot;-280.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;etc (atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root Context (/)&amp;#45;&amp;gt;etc --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Root Context (/)-&gt;etc&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M377.77,-357.51C398.89,-343.7 428.58,-324.28 451.83,-309.07&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;453.64,-312.08 460.09,-303.67 449.8,-306.22 453.64,-312.08&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;453.19&quot; y=&quot;-324.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- people --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;people&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M126.06,-213.6C126.06,-213.6 12,-213.6 12,-213.6 6,-213.6 0,-207.6 0,-201.6 0,-201.6 0,-189.6 0,-189.6 0,-183.6 6,-177.6 12,-177.6 12,-177.6 126.06,-177.6 126.06,-177.6 132.06,-177.6 138.06,-183.6 138.06,-189.6 138.06,-189.6 138.06,-201.6 138.06,-201.6 138.06,-207.6 132.06,-213.6 126.06,-213.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;69.03&quot; y=&quot;-191.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;people (atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- usr&amp;#45;&amp;gt;people --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;usr-&gt;people&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M227.09,-265.96C211.18,-260.7 193.98,-254.65 178.37,-248.4 156.56,-239.66 132.92,-228.66 113.23,-219.05&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;114.9,-215.97 104.38,-214.7 111.8,-222.25 114.9,-215.97&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;208.7&quot; y=&quot;-235.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;subcontext&lt;/text&gt;
&lt;/g&gt;
&lt;!-- bin --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;bin&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M262.34,-213.6C262.34,-213.6 167.71,-213.6 167.71,-213.6 161.71,-213.6 155.71,-207.6 155.71,-201.6 155.71,-201.6 155.71,-189.6 155.71,-189.6 155.71,-183.6 161.71,-177.6 167.71,-177.6 167.71,-177.6 262.34,-177.6 262.34,-177.6 268.34,-177.6 274.34,-183.6 274.34,-189.6 274.34,-189.6 274.34,-201.6 274.34,-201.6 274.34,-207.6 268.34,-213.6 262.34,-213.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;215.03&quot; y=&quot;-191.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;bin (atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- usr&amp;#45;&amp;gt;bin --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;usr-&gt;bin&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M270.4,-266.25C260.54,-253.85 247.04,-236.87 235.84,-222.78&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;238.77,-220.85 229.81,-215.2 233.29,-225.2 238.77,-220.85&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;286.04&quot; y=&quot;-235.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;subcontext&lt;/text&gt;
&lt;/g&gt;
&lt;!-- local --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;local&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M408,-213.6C408,-213.6 304.06,-213.6 304.06,-213.6 298.06,-213.6 292.06,-207.6 292.06,-201.6 292.06,-201.6 292.06,-189.6 292.06,-189.6 292.06,-183.6 298.06,-177.6 304.06,-177.6 304.06,-177.6 408,-177.6 408,-177.6 414,-177.6 420,-183.6 420,-189.6 420,-189.6 420,-201.6 420,-201.6 420,-207.6 414,-213.6 408,-213.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;356.03&quot; y=&quot;-191.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;local (atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- usr&amp;#45;&amp;gt;local --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;usr-&gt;local&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M303.03,-266.24C308.73,-260.76 314.84,-254.52 320.03,-248.4 326.57,-240.68 333.09,-231.78 338.74,-223.57&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;341.64,-225.52 344.3,-215.26 335.83,-221.62 341.64,-225.52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;363.12&quot; y=&quot;-235.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;subcontext&lt;/text&gt;
&lt;/g&gt;
&lt;!-- mtab --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;mtab&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M525.83,-213.6C525.83,-213.6 450.23,-213.6 450.23,-213.6 444.23,-213.6 438.23,-207.6 438.23,-201.6 438.23,-201.6 438.23,-189.6 438.23,-189.6 438.23,-183.6 444.23,-177.6 450.23,-177.6 450.23,-177.6 525.83,-177.6 525.83,-177.6 531.83,-177.6 537.83,-183.6 537.83,-189.6 537.83,-189.6 537.83,-201.6 537.83,-201.6 537.83,-207.6 531.83,-213.6 525.83,-213.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;488.03&quot; y=&quot;-191.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;mtab (binding)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- etc&amp;#45;&amp;gt;mtab --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;etc-&gt;mtab&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M488.03,-266.25C488.03,-254.56 488.03,-238.79 488.03,-225.22&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;491.53,-225.52 488.03,-215.52 484.53,-225.52 491.53,-225.52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;509.42&quot; y=&quot;-235.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- exports --&gt;
&lt;g id=&quot;node9&quot; class=&quot;node&quot;&gt;
&lt;title&gt;exports&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M656.44,-213.6C656.44,-213.6 567.62,-213.6 567.62,-213.6 561.62,-213.6 555.62,-207.6 555.62,-201.6 555.62,-201.6 555.62,-189.6 555.62,-189.6 555.62,-183.6 561.62,-177.6 567.62,-177.6 567.62,-177.6 656.44,-177.6 656.44,-177.6 662.44,-177.6 668.44,-183.6 668.44,-189.6 668.44,-189.6 668.44,-201.6 668.44,-201.6 668.44,-207.6 662.44,-213.6 656.44,-213.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;612.03&quot; y=&quot;-191.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;exports (binding)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- etc&amp;#45;&amp;gt;exports --&gt;
&lt;g id=&quot;edge9&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;etc-&gt;exports&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M512.82,-266.04C531.49,-252.97 557.31,-234.91 577.92,-220.47&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;579.85,-223.4 586.04,-214.79 575.84,-217.66 579.85,-223.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;582.52&quot; y=&quot;-235.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ed --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ed&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M114,-124.8C114,-124.8 24.05,-124.8 24.05,-124.8 18.05,-124.8 12.05,-118.8 12.05,-112.8 12.05,-112.8 12.05,-100.8 12.05,-100.8 12.05,-94.8 18.05,-88.8 24.05,-88.8 24.05,-88.8 114,-88.8 114,-88.8 120,-88.8 126,-94.8 126,-100.8 126,-100.8 126,-112.8 126,-112.8 126,-118.8 120,-124.8 114,-124.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;69.03&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ed (atomic name)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- people&amp;#45;&amp;gt;ed --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;people-&gt;ed&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M69.03,-177.45C69.03,-165.76 69.03,-149.99 69.03,-136.42&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;72.53,-136.72 69.03,-126.72 65.53,-136.72 72.53,-136.72&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;99.36&quot; y=&quot;-147&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;subcontext&lt;/text&gt;
&lt;/g&gt;
&lt;!-- .cshrc --&gt;
&lt;g id=&quot;node10&quot; class=&quot;node&quot;&gt;
&lt;title&gt;.cshrc&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M109.35,-36C109.35,-36 28.71,-36 28.71,-36 22.71,-36 16.71,-30 16.71,-24 16.71,-24 16.71,-12 16.71,-12 16.71,-6 22.71,0 28.71,0 28.71,0 109.35,0 109.35,0 115.35,0 121.35,-6 121.35,-12 121.35,-12 121.35,-24 121.35,-24 121.35,-30 115.35,-36 109.35,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;69.03&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;.cshrc (binding)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ed&amp;#45;&amp;gt;.cshrc --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;ed-&gt;.cshrc&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M69.03,-88.65C69.03,-76.96 69.03,-61.19 69.03,-47.62&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;72.53,-47.92 69.03,-37.92 65.53,-47.92 72.53,-47.92&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;90.42&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;binding&lt;/text&gt;
&lt;/g&gt;
&lt;!-- compound --&gt;
&lt;g id=&quot;node11&quot; class=&quot;node&quot;&gt;
&lt;title&gt;compound&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;549.15,-396.8 422.91,-396.8 422.91,-355.2 555.15,-355.2 555.15,-390.8 549.15,-396.8&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;549.15,-396.8 549.15,-390.8&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;555.15,-390.8 549.15,-390.8&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;489.03&quot; y=&quot;-380.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;/usr/people/ed/.cshrc&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;489.03&quot; y=&quot;-363.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Compound Name)&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Tree structure&lt;/strong&gt;: Hierarchical, like a file system&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Atomic names&lt;/strong&gt;: Cannot be subdivided further&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compound names&lt;/strong&gt;: Path-like combinations of atomic names&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bindings&lt;/strong&gt;: Name-to-object mappings, core of JNDI operations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contexts&lt;/strong&gt;: Containers for bindings, can be nested (subcontexts)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JNDI compound names&lt;/strong&gt;: Can use different syntaxes (slash, dot, etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; — JNDI implements these naming concepts&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../jndi-context&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-context&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Context&lt;/a&gt; — contexts are central to JNDI operations&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jndi-binding&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-binding&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Binding&lt;/a&gt; — bindings are the associations within contexts&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../atomic-name&quot; class=&quot;internal alias&quot; data-slug=&quot;atomic-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Atomic Name&lt;/a&gt;, &lt;a href=&quot;../../compound-name&quot; class=&quot;internal alias&quot; data-slug=&quot;compound-name&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compound Name&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../subcontext&quot; class=&quot;internal alias&quot; data-slug=&quot;subcontext&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Subcontext&lt;/a&gt; — subcontexts enable hierarchical organization&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Compound name syntax&lt;/strong&gt;: Different providers may use different separators&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reserved characters&lt;/strong&gt;: Some characters may need escaping in names&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context destruction&lt;/strong&gt;: Destroying a context may not destroy its subcontexts&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lazy loading&lt;/strong&gt;: Large contexts may load bindings lazily&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compound name parsing&lt;/strong&gt;: Be careful with provider-specific parsing rules&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jndi-spi</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jndi-spi" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jndi-spi.md" />
    <summary>The Problem JNDI defines a common client API, but how do different directory vendors (LDAP, NIS, Novell) make their services accessible through that API? There needs to be a standardized way for vendors to plug their proprietary protocols into the JNDI framework.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JNDI defines a common client API, but how do different directory vendors (LDAP, NIS, Novell) make their services accessible through that API? There needs to be a standardized way for vendors to plug their proprietary protocols into the JNDI framework.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The JNDI SPI is a framework that naming and directory service vendors implement to bridge JNDI client API calls to their specific protocols. It’s the “converse” of the API—while the API is for client developers, the SPI is for vendor implementors.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Vendor implements &lt;code class=&quot;notranslate&quot;&gt;javax.naming.spi&lt;/code&gt; interfaces (&lt;code class=&quot;notranslate&quot;&gt;InitialContextFactory&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;StateFactory&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;Provider maps JNDI operations (lookup, bind, search) to vendor-specific protocol operations&lt;/li&gt;
&lt;li&gt;For example, LDAP provider converts &lt;code class=&quot;notranslate&quot;&gt;ctx.lookup(&quot;cn=John&quot;)&lt;/code&gt; into an LDAP search operation&lt;/li&gt;
&lt;li&gt;Provider handles connection management, authentication, and protocol details&lt;/li&gt;
&lt;li&gt;Client code remains unchanged regardless of which provider is plugged in&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Sun provides a free LDAP service provider; vendors can write their own for proprietary directories.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;672pt&quot; height=&quot;209pt&quot; viewBox=&quot;0.00 0.00 672.00 209.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 205)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-205 668.27,-205 668.27,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_providers&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;422.4,-8 422.4,-193 542.67,-193 542.67,-8 422.4,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;482.53&quot; y=&quot;-176.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Service Providers&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI Client API --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JNDI Client API&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;110.11,-106 0,-106 0,-70 110.11,-70 110.11,-106&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;55.06&quot; y=&quot;-83.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI Client API&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JNDI SPI&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;266.54,-106 198.19,-88 266.54,-70 334.89,-88 266.54,-106&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;266.54&quot; y=&quot;-83.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI SPI&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI Client API&amp;#45;&amp;gt;JNDI SPI --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI Client API-&gt;JNDI SPI&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M110.55,-88C133.26,-88 160.09,-88 185,-88&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;184.77,-91.5 194.77,-88 184.77,-84.5 184.77,-91.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;154.15&quot; y=&quot;-92.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;delegates&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP Provider --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LDAP Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M522.67,-160C522.67,-160 442.4,-160 442.4,-160 436.4,-160 430.4,-154 430.4,-148 430.4,-148 430.4,-136 430.4,-136 430.4,-130 436.4,-124 442.4,-124 442.4,-124 522.67,-124 522.67,-124 528.67,-124 534.67,-130 534.67,-136 534.67,-136 534.67,-148 534.67,-148 534.67,-154 528.67,-160 522.67,-160&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;482.53&quot; y=&quot;-137.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LDAP Provider&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI&amp;#45;&amp;gt;LDAP Provider --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI SPI-&gt;LDAP Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M302.88,-96.92C334.43,-104.88 381.36,-116.72 419.21,-126.27&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;418.1,-129.6 428.66,-128.66 419.82,-122.82 418.1,-129.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;382.64&quot; y=&quot;-128.73&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LDAP ops&lt;/text&gt;
&lt;/g&gt;
&lt;!-- NIS Provider --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;NIS Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M515.67,-106C515.67,-106 449.4,-106 449.4,-106 443.4,-106 437.4,-100 437.4,-94 437.4,-94 437.4,-82 437.4,-82 437.4,-76 443.4,-70 449.4,-70 449.4,-70 515.67,-70 515.67,-70 521.67,-70 527.67,-76 527.67,-82 527.67,-82 527.67,-94 527.67,-94 527.67,-100 521.67,-106 515.67,-106&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;482.53&quot; y=&quot;-83.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NIS Provider&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI&amp;#45;&amp;gt;NIS Provider --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI SPI-&gt;NIS Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M336.72,-88C365.57,-88 398.63,-88 425.87,-88&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;425.65,-91.5 435.65,-88 425.65,-84.5 425.65,-91.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;382.64&quot; y=&quot;-92.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NIS ops&lt;/text&gt;
&lt;/g&gt;
&lt;!-- NDS Provider --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;NDS Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M518.39,-52C518.39,-52 446.67,-52 446.67,-52 440.67,-52 434.67,-46 434.67,-40 434.67,-40 434.67,-28 434.67,-28 434.67,-22 440.67,-16 446.67,-16 446.67,-16 518.39,-16 518.39,-16 524.39,-16 530.39,-22 530.39,-28 530.39,-28 530.39,-40 530.39,-40 530.39,-46 524.39,-52 518.39,-52&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;482.53&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NDS Provider&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI SPI&amp;#45;&amp;gt;NDS Provider --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI SPI-&gt;NDS Provider&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M302.88,-79.08C335.62,-70.82 384.92,-58.38 423.44,-48.66&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;424.2,-52.08 433.04,-46.24 422.49,-45.29 424.2,-52.08&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;382.64&quot; y=&quot;-70.04&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NDS ops&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP Server --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LDAP Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M664.27,-156.73C664.27,-158.53 643.52,-160 617.97,-160 592.42,-160 571.67,-158.53 571.67,-156.73 571.67,-156.73 571.67,-127.27 571.67,-127.27 571.67,-125.47 592.42,-124 617.97,-124 643.52,-124 664.27,-125.47 664.27,-127.27 664.27,-127.27 664.27,-156.73 664.27,-156.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M664.27,-156.73C664.27,-154.92 643.52,-153.45 617.97,-153.45 592.42,-153.45 571.67,-154.92 571.67,-156.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;617.97&quot; y=&quot;-137.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LDAP Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LDAP Provider&amp;#45;&amp;gt;LDAP Server --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;LDAP Provider-&gt;LDAP Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M535.12,-142C543.2,-142 551.59,-142 559.78,-142&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;559.66,-145.5 569.66,-142 559.66,-138.5 559.66,-145.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- NIS Server --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;NIS Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M657.27,-102.73C657.27,-104.53 639.65,-106 617.97,-106 596.28,-106 578.67,-104.53 578.67,-102.73 578.67,-102.73 578.67,-73.27 578.67,-73.27 578.67,-71.47 596.28,-70 617.97,-70 639.65,-70 657.27,-71.47 657.27,-73.27 657.27,-73.27 657.27,-102.73 657.27,-102.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M657.27,-102.73C657.27,-100.92 639.65,-99.45 617.97,-99.45 596.28,-99.45 578.67,-100.92 578.67,-102.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;617.97&quot; y=&quot;-83.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NIS Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- NIS Provider&amp;#45;&amp;gt;NIS Server --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;NIS Provider-&gt;NIS Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M527.97,-88C540.5,-88 554.23,-88 567.06,-88&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;567.03,-91.5 577.03,-88 567.03,-84.5 567.03,-91.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- NDS Server --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;NDS Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M659.99,-48.73C659.99,-50.53 641.16,-52 617.97,-52 594.78,-52 575.95,-50.53 575.95,-48.73 575.95,-48.73 575.95,-19.27 575.95,-19.27 575.95,-17.47 594.78,-16 617.97,-16 641.16,-16 659.99,-17.47 659.99,-19.27 659.99,-19.27 659.99,-48.73 659.99,-48.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M659.99,-48.73C659.99,-46.92 641.16,-45.45 617.97,-45.45 594.78,-45.45 575.95,-46.92 575.95,-48.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;617.97&quot; y=&quot;-29.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;NDS Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- NDS Provider&amp;#45;&amp;gt;NDS Server --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;NDS Provider-&gt;NDS Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M530.58,-34C541.49,-34 553.18,-34 564.32,-34&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;564.16,-37.5 574.16,-34 564.16,-30.5 564.16,-37.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Vendor extensibility&lt;/strong&gt;: Any vendor can implement a JNDI provider&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protocol translation&lt;/strong&gt;: Converts generic JNDI calls to specific protocol operations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pluggable&lt;/strong&gt;: Replace providers without changing client code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standardized&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;javax.naming.spi&lt;/code&gt; package defines the contract&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bundled with J2EE&lt;/strong&gt;: Many J2EE servers bundle custom JNDI implementations&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../jndi-architecture&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-architecture&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Architecture&lt;/a&gt; — SPI is one half of JNDI&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt; — SPI enables JNDI’s unified interface&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC Drivers&lt;/a&gt; — similar plugin architecture for databases&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../jndi-client-api&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi-client-api&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI Client API&lt;/a&gt; — SPI is for vendors, API is for developers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Provider not found&lt;/strong&gt;: Classpath must include the provider library&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version compatibility&lt;/strong&gt;: Provider must match JNDI version&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connection pooling&lt;/strong&gt;: Provider may or may not implement connection pooling&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Thread safety&lt;/strong&gt;: Provider implementations must be thread-safe&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jsp</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jsp" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jsp.md" />
    <summary>The Problem Writing HTML in Java servlets is painful—Java code is mixed with HTML strings.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-05-13T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>May 13, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="web" label="web" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Writing HTML in Java servlets is painful—Java code is mixed with HTML strings. Web designers who don’t know Java need to modify the look-and-feel. How can we separate presentation from business logic?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JSP (JavaServer Pages) is similar to servlets but centered on look-and-feel. JSP scripts are HTML-like with embedded Java code, compiled into servlets. They enable non-Java staff to maintain the UI separately from business logic.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;JSP script&lt;/strong&gt;: HTML file with embedded Java (scriptlets, expressions, declarations, directives)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lifecycle&lt;/strong&gt;: Translation (JSP → servlet source) → Compilation (servlet source → .class) → init() → service() → destroy()&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Directives&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;%@ page %&gt;&lt;/code&gt; (page settings), &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;%@ include %&gt;&lt;/code&gt; (static includes), &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;%@ taglib %&gt;&lt;/code&gt; (custom tags)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scripting elements&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;%! %&gt;&lt;/code&gt; declarations, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;% %&gt;&lt;/code&gt; scriptlets, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;%= %&gt;&lt;/code&gt; expressions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EL (Expression Language)&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;${bean.property}&lt;/code&gt; syntax for accessing Java beans without scriptlets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JSTL&lt;/strong&gt;: Standard tag library (&lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;c:if&gt;&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;c:forEach&gt;&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;c:out&gt;&lt;/code&gt;) enabling logic without Java code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implicit objects&lt;/strong&gt;: request, response, session, application, out, pageContext, config, page, exception&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compilation&lt;/strong&gt;: JSP is compiled into a servlet on first access&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Separation&lt;/strong&gt;: UI in JSP, business logic in EJB/servlets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE integration&lt;/strong&gt;: Can call EJB components, use JNDI, etc.&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;JSP is perfect when you want physically separate, easily maintainable UI code.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;555pt&quot; height=&quot;111pt&quot; viewBox=&quot;0.00 0.00 555.00 111.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 107)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-107 551.05,-107 551.05,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- JSP File --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JSP File&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;184.31,-63 0,-63 0,-27 190.31,-27 190.31,-57 184.31,-63&quot;&gt;&lt;/polygon&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;184.31,-63 184.31,-57&quot;&gt;&lt;/polyline&gt;
&lt;polyline fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;190.31,-57 184.31,-57&quot;&gt;&lt;/polyline&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;95.15&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JSP (HTML + embedded Java)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Servlet --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Servlet&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;373.34,-103 317.69,-103 317.69,-67 373.34,-67 373.34,-103&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;345.51&quot; y=&quot;-80.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Servlet&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JSP File&amp;#45;&amp;gt;Servlet --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JSP File-&gt;Servlet&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M190.76,-60.24C230.87,-66.7 275.35,-73.86 306.11,-78.81&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;305.27,-82.22 315.69,-80.36 306.38,-75.31 305.27,-82.22&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252.05&quot; y=&quot;-80.56&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;compiles to&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M365.23,-36C365.23,-36 325.8,-36 325.8,-36 319.8,-36 313.8,-30 313.8,-24 313.8,-24 313.8,-12 313.8,-12 313.8,-6 319.8,0 325.8,0 325.8,0 365.23,0 365.23,0 371.23,0 377.23,-6 377.23,-12 377.23,-12 377.23,-24 377.23,-24 377.23,-30 371.23,-36 365.23,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;345.51&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JSP File&amp;#45;&amp;gt;Browser --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JSP File-&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M190.76,-34.72C229.29,-30.53 271.86,-25.9 302.41,-22.58&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;302.44,-26.1 312,-21.53 301.68,-19.14 302.44,-26.1&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252.05&quot; y=&quot;-36.51&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTTP response&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Component --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJB Component&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;547.05,-103 438.89,-103 438.89,-67 547.05,-67 547.05,-103&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;492.97&quot; y=&quot;-80.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Component&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Servlet&amp;#45;&amp;gt;EJB Component --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Servlet-&gt;EJB Component&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M373.53,-85C388.71,-85 408.35,-85 427.26,-85&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;427.06,-88.5 437.06,-85 427.06,-81.5 427.06,-88.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;408.06&quot; y=&quot;-89.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;calls&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser&amp;#45;&amp;gt;JSP File --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Browser-&gt;JSP File&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M313.53,-9.33C307.68,-8.03 301.59,-6.89 295.8,-6.2 257.19,-1.59 246.65,0.25 208.31,-6.2 188.61,-9.51 167.75,-15.88 149.44,-22.51&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;148.24,-19.22 140.1,-26.01 150.69,-25.78 148.24,-19.22&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;252.05&quot; y=&quot;-10.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTTP request&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;HTML-centric&lt;/strong&gt;: Looks like HTML with embedded Java&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compiles to servlet&lt;/strong&gt;: Under the hood, it’s a servlet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lifecycle&lt;/strong&gt;: Translation → Compilation → init → service → destroy&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Directives&lt;/strong&gt;: page, include, taglib — control page behavior&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EL (Expression Language)&lt;/strong&gt;: ${} syntax, auto-scoped attribute lookup&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JSTL&lt;/strong&gt;: Core, formatting, SQL, XML, functions tag libraries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implicit objects&lt;/strong&gt;: 9 pre-defined objects accessible in any JSP&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No compiler needed&lt;/strong&gt;: At deployment time&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Non-Java friendly&lt;/strong&gt;: Web designers can maintain JSPs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Separate maintenance&lt;/strong&gt;: UI separated from business logic&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../servlets&quot; class=&quot;internal alias&quot; data-slug=&quot;servlets&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Servlets&lt;/a&gt; — JSP compiles to servlets&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — JSP is part of J2EE&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — JSP can call EJBs&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jsp&quot; class=&quot;internal alias&quot; data-slug=&quot;jsp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JSP&lt;/a&gt; — alternative to servlets for presentation&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt; — JSP is presentation, EJBs are business logic&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Scriptlet pollution&lt;/strong&gt;: Avoid too much Java in JSP (use JSTL/EL)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;First-access delay&lt;/strong&gt;: Compilation happens on first access&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chapter 22&lt;/strong&gt;: See EJB with JSP examples there&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern alternative&lt;/strong&gt;: Consider Facelets/Thymeleaf in modern apps&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>jta-jts</title>
    <link href="https://animishraa05.github.io/wiki/ejb/jta-jts" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/jta-jts.md" />
    <summary>The Problem Distributed transactions across multiple databases or systems need coordination.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="transactions" label="transactions" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Distributed transactions across multiple databases or systems need coordination. Without a standard API, each vendor implements transactions differently, breaking portability and making it hard to build reliable enterprise applications.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;JTA (Java Transaction API) and JTS (Java Transaction Service) provide reliable transaction support for J2EE components. JTA is the API that developers use; JTS is the underlying transaction service implementation (based on CORBA OTS).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;JTA API&lt;/strong&gt;: Developer uses &lt;code class=&quot;notranslate&quot;&gt;UserTransaction&lt;/code&gt; interface (looked up via JNDI)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transaction demarcation&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;begin()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;commit()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;rollback()&lt;/code&gt; methods&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JTS&lt;/strong&gt;: Implements CORBA Object Transaction Service (OTS) specification&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Distributed transactions&lt;/strong&gt;: Coordinates transactions across multiple resources (XA protocol)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container-managed&lt;/strong&gt;: EJB containers can manage transactions declaratively (CMT)&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Chapter 12 explains JTA/JTS in detail.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;715pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 715.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 710.56,-94 710.56,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- EJB Component --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJB Component&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;108.17,-63 0,-63 0,-27 108.17,-27 108.17,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;54.08&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Component&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JTA API --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JTA API&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;286.48,-63 221.93,-45 286.48,-27 351.03,-45 286.48,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;286.48&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JTA API&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Component&amp;#45;&amp;gt;JTA API --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB Component-&gt;JTA API&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M108.52,-45C138.37,-45 176.07,-45 209,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;208.91,-48.5 218.91,-45 208.91,-41.5 208.91,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;165.05&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;begin/commit&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JTS Service --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JTS Service&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;522.38,-63 439.11,-63 439.11,-27 522.38,-27 522.38,-63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;480.75&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JTS Service&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JTA API&amp;#45;&amp;gt;JTS Service --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JTA API-&gt;JTS Service&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M352.84,-45C377.15,-45 404.39,-45 427.38,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;427.12,-48.5 437.12,-45 427.12,-41.5 427.12,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;395.07&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;delegates&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Database 1 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Database 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M706.56,-86.73C706.56,-88.53 689.12,-90 667.66,-90 646.19,-90 628.75,-88.53 628.75,-86.73 628.75,-86.73 628.75,-57.27 628.75,-57.27 628.75,-55.47 646.19,-54 667.66,-54 689.12,-54 706.56,-55.47 706.56,-57.27 706.56,-57.27 706.56,-86.73 706.56,-86.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M706.56,-86.73C706.56,-84.92 689.12,-83.45 667.66,-83.45 646.19,-83.45 628.75,-84.92 628.75,-86.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;667.66&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Database 1&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JTS Service&amp;#45;&amp;gt;Database 1 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JTS Service-&gt;Database 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M522.78,-50.99C550.59,-55.05 587.49,-60.44 616.95,-64.74&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;616.36,-68.19 626.76,-66.17 617.37,-61.27 616.36,-68.19&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;575.57&quot; y=&quot;-67.47&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;XA protocol&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Database 2 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Database 2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M706.56,-32.73C706.56,-34.53 689.12,-36 667.66,-36 646.19,-36 628.75,-34.53 628.75,-32.73 628.75,-32.73 628.75,-3.27 628.75,-3.27 628.75,-1.47 646.19,0 667.66,0 689.12,0 706.56,-1.47 706.56,-3.27 706.56,-3.27 706.56,-32.73 706.56,-32.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M706.56,-32.73C706.56,-30.92 689.12,-29.45 667.66,-29.45 646.19,-29.45 628.75,-30.92 628.75,-32.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;667.66&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Database 2&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JTS Service&amp;#45;&amp;gt;Database 2 --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JTS Service-&gt;Database 2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M522.68,-36.33C528.6,-35.2 534.64,-34.12 540.38,-33.2 565.56,-29.16 593.72,-25.67 617.05,-23.06&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;617.35,-26.54 626.91,-21.98 616.59,-19.59 617.35,-26.54&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;575.57&quot; y=&quot;-37.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;XA protocol&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;JTA&lt;/strong&gt;: API for transaction demarcation (developer-facing)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JTS&lt;/strong&gt;: Service implementation (CORBA OTS-based)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Distributed&lt;/strong&gt;: Coordinates across multiple resources&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;XA support&lt;/strong&gt;: Two-phase commit protocol&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CMT integration&lt;/strong&gt;: EJB container can manage transactions declaratively&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Transactions in EJB&lt;/a&gt; — JTA/JTS provide transaction support&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../declarative-vs-programmatic-transactions&quot; class=&quot;internal alias&quot; data-slug=&quot;declarative-vs-programmatic-transactions&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CMT vs BMT&lt;/a&gt; — JTA enables both models&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — container uses JTA/JTS for CMT&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — JTA/JTS are part of J2EE&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Heuristic outcomes&lt;/strong&gt;: Transactions may have heuristic commits/rollbacks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeout&lt;/strong&gt;: Transactions can timeout, causing rollback&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nested transactions&lt;/strong&gt;: J2EE uses flat transactions, not nested&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource enlistment&lt;/strong&gt;: Resources must support XA for distributed transactions&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>local-home-interface</title>
    <link href="https://animishraa05.github.io/wiki/ejb/local-home-interface" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/local-home-interface.md" />
    <summary>The Problem The regular Home Interface uses RMI-IIOP for network communication—even when the client and bean are in the same JVM.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The regular Home Interface uses RMI-IIOP for network communication—even when the client and bean are in the same JVM. This adds unnecessary overhead (serialization, network stack) for local calls.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The Local Home Interface (&lt;code class=&quot;notranslate&quot;&gt;javax.ejb.EJBLocalHome&lt;/code&gt;) is the high-performance version of the Home Interface. It’s used when the client and bean are in the same JVM—no network calls, no &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;, direct memory access.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Extends &lt;code class=&quot;notranslate&quot;&gt;EJBLocalHome&lt;/code&gt;&lt;/strong&gt;: Unlike regular Home which extends &lt;code class=&quot;notranslate&quot;&gt;EJBHome&lt;/code&gt; (which extends &lt;code class=&quot;notranslate&quot;&gt;java.rmi.Remote&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;&lt;/strong&gt;: Since there’s no network call, there’s no possibility of network failure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Returns Local Interface&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;create()&lt;/code&gt; returns &lt;code class=&quot;notranslate&quot;&gt;HelloLocal&lt;/code&gt; (local interface), not remote&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fast&lt;/strong&gt;: Uses pass-by-reference semantics within the same JVM&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: LocalHome Pages: 1 --&gt;
&lt;svg width=&quot;915pt&quot; height=&quot;107pt&quot; viewBox=&quot;0.00 0.00 915.00 107.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 103)&quot;&gt;
&lt;title&gt;LocalHome&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-103 911.23,-103 911.23,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_same_jvm&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-8 8,-91 899.23,-91 899.23,-8 8,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;453.61&quot; y=&quot;-74.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Same JVM&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;C&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;99.27,-55 16,-55 16,-19 99.27,-19 99.27,-55&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;57.64&quot; y=&quot;-32.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client Code&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LH --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LH&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;318.4,-57.8 192,-57.8 192,-16.2 318.4,-16.2 318.4,-57.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;255.2&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Local Home Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;255.2&quot; y=&quot;-24.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(EJBLocalHome)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- C&amp;#45;&amp;gt;LH --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;C-&gt;LH&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M99.63,-37C122.96,-37 152.88,-37 180.17,-37&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;180.17,-40.5 190.17,-37 180.17,-33.5 180.17,-40.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;145.64&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. create()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LL --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;LL&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;600.54,-57.8 482.69,-57.8 482.69,-16.2 600.54,-16.2 600.54,-57.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;541.62&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Local EJB Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;541.62&quot; y=&quot;-24.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(EJBLocalObject)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LH&amp;#45;&amp;gt;LL --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;LH-&gt;LL&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M318.62,-37C363.54,-37 424.17,-37 470.72,-37&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;470.72,-40.5 480.72,-37 470.72,-33.5 470.72,-40.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;400.55&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Return Local Object&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;891.23,-55 785.43,-55 785.43,-19 891.23,-19 891.23,-55&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;838.33&quot; y=&quot;-32.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Enterprise Bean&lt;/text&gt;
&lt;/g&gt;
&lt;!-- LL&amp;#45;&amp;gt;Bean --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;LL-&gt;Bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M600.84,-37C650.75,-37 722.5,-37 773.86,-37&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;773.64,-40.5 783.64,-37 773.64,-33.5 773.64,-40.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;692.99&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. Direct call (no network)&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;No &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;&lt;/strong&gt;: Cleaner method signatures&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pass-by-reference&lt;/strong&gt;: Parameters passed directly (not serialized)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Faster&lt;/strong&gt;: No RMI-IIOP overhead&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Same JVM requirement&lt;/strong&gt;: Cannot be used for remote clients&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt; (remote version)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../remote-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;remote-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Remote Interface&lt;/a&gt; (contrast: remote has network overhead)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ejb-object&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-object&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Object&lt;/a&gt;, &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt; (remote, has &lt;code class=&quot;notranslate&quot;&gt;RemoteException&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Mixing local and remote&lt;/strong&gt;: If you look up a LocalHome via JNDI from a remote client, you’ll get an error&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ClassLoader issues&lt;/strong&gt;: In same JVM but different ClassLoaders can still cause problems&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transaction propagation&lt;/strong&gt;: Local calls propagate transactions automatically (unlike remote which may require distributed transactions)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;code-example&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Code Example&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#code-example&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HelloLocalHome&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; javax.ejb.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;EJBLocalHome&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    HelloLocal &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;throws&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; javax.ejb.CreateException;&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // Note: No RemoteException!&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
  </entry><entry>
    <title>location-transparency</title>
    <link href="https://animishraa05.github.io/wiki/ejb/location-transparency" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/location-transparency.md" />
    <summary>The Problem In distributed systems, clients need to know where a service lives (machine name, IP address, port).</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="jndi" label="jndi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;In distributed systems, clients need to know where a service lives (machine name, IP address, port). If the service moves to a different server, you must rewrite and recompile all client code. This creates tight coupling between clients and server locations.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;EJB achieves location transparency through JNDI (Java Naming and Directory Interface). Clients look up beans by a logical name (nickname) like &lt;code class=&quot;notranslate&quot;&gt;&quot;HelloHome&quot;&lt;/code&gt;, not by physical address. The JNDI naming service maps this nickname to the actual Home Object reference—change the server, update JNDI, client code stays the same.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Deployer binds nickname&lt;/strong&gt;: During deployment, container registers Home Object with JNDI using a nickname (e.g., &lt;code class=&quot;notranslate&quot;&gt;&quot;HelloHome&quot;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client looks up by nickname&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;ctx.lookup(&quot;HelloHome&quot;)&lt;/code&gt; — no machine names in client code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JNDI resolves location&lt;/strong&gt;: JNDI service (LDAP, COS Naming, or in-process) finds the actual object reference&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server moves?&lt;/strong&gt;: Just update JNDI — client code unchanged&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: LocationTransparency Pages: 1 --&gt;
&lt;svg width=&quot;339pt&quot; height=&quot;293pt&quot; viewBox=&quot;0.00 0.00 339.00 293.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 288.8)&quot;&gt;
&lt;title&gt;LocationTransparency&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-288.8 334.64,-288.8 334.64,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_server&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;14.77,-8 14.77,-90.4 156.77,-90.4 156.77,-8 14.77,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.77&quot; y=&quot;-73.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server (Any Machine)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;166.55,-284.8 4.99,-284.8 4.99,-243.2 166.55,-243.2 166.55,-284.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.77&quot; y=&quot;-268.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client Code&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.77&quot; y=&quot;-251.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ctx.lookup(&quot;HelloHome&quot;)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;JNDI&lt;/title&gt;
&lt;path fill=&quot;lightyellow&quot; stroke=&quot;black&quot; d=&quot;M171.54,-185.2C171.54,-188.07 133.1,-190.4 85.77,-190.4 38.44,-190.4 0,-188.07 0,-185.2 0,-185.2 0,-138.4 0,-138.4 0,-135.53 38.44,-133.2 85.77,-133.2 133.1,-133.2 171.54,-135.53 171.54,-138.4 171.54,-138.4 171.54,-185.2 171.54,-185.2&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M171.54,-185.2C171.54,-182.33 133.1,-180 85.77,-180 38.44,-180 0,-182.33 0,-185.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.77&quot; y=&quot;-166&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JNDI Naming Service&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.77&quot; y=&quot;-149.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(LDAP, COS Naming, etc.)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;JNDI --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;JNDI&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M26.31,-242.79C19.37,-238.07 13.2,-232.28 8.8,-225.2 2.25,-214.69 5.47,-205.16 13.48,-196.89&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;15.5,-199.76 20.88,-190.63 10.98,-194.41 15.5,-199.76&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;75.28&quot; y=&quot;-212.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. Lookup by nickname&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI&amp;#45;&amp;gt;Client --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI-&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M131.41,-190.68C141.96,-200.75 148.4,-212.73 141.77,-225.2 139.9,-228.72 137.53,-231.98 134.84,-234.98&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;132.55,-232.33 127.62,-241.71 137.32,-237.44 132.55,-232.33&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;237.55&quot; y=&quot;-212.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. Return Home Object reference&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Home --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Home&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;131.28,-57.6 40.25,-57.6 40.25,-16 131.28,-16 131.28,-57.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.77&quot; y=&quot;-41&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Home Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.77&quot; y=&quot;-24.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(HelloHome)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- JNDI&amp;#45;&amp;gt;Home --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;JNDI-&gt;Home&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M85.77,-132.89C85.77,-113.99 85.77,-88.98 85.77,-69.36&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;89.27,-69.45 85.77,-59.45 82.27,-69.45 89.27,-69.45&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;168.75&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Resolve to actual reference&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;“Write Once, Run Anywhere”&lt;/strong&gt;: Client code portable across different server deployments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Naming services&lt;/strong&gt;: JNDI supports LDAP, CORBA Naming, in-process JNDI trees&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vendor-independent&lt;/strong&gt;: The lookup code is standard JNDI—works on any EJB container&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Purchased components&lt;/strong&gt;: If you buy pre-written beans (no source), location transparency is essential—you can’t rewrite them&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../jndi&quot; class=&quot;internal alias&quot; data-slug=&quot;jndi&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JNDI&lt;/a&gt;, &lt;a href=&quot;../../home-interface&quot; class=&quot;internal alias&quot; data-slug=&quot;home-interface&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Home Interface&lt;/a&gt; (what gets looked up)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../distributed-objects&quot; class=&quot;internal alias&quot; data-slug=&quot;distributed-objects&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Distributed Objects&lt;/a&gt; (clients can access beans anywhere)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../middleware&quot; class=&quot;internal alias&quot; data-slug=&quot;middleware&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Middleware&lt;/a&gt; (JNDI is a middleware service)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Hard-coded addresses (client breaks if server moves)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;JNDI properties still machine-specific&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;Context.PROVIDER_URL&lt;/code&gt; specifies naming service location—but this is configuration, not code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network partition&lt;/strong&gt;: If JNDI service is unreachable, lookup fails (even if bean is running)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nickname collisions&lt;/strong&gt;: Two beans with same JNDI name cause deployment errors&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>persistence-concepts</title>
    <link href="https://animishraa05.github.io/wiki/ejb/persistence-concepts" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/persistence-concepts.md" />
    <summary>The Problem Objects live in RAM—when the program stops, they’re gone.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="database" label="database" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Objects live in RAM—when the program stops, they’re gone. To keep data permanently (across restarts, for other applications to use), objects must be saved to persistent storage (database, filesystem). What are the ways to persist Java objects?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;There are two main ways to persist Java objects:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Serialization&lt;/strong&gt;: Convert the entire object to a byte stream (blob) and save it. Simple but not queryable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Object-Relational Mapping (ORM)&lt;/strong&gt;: Decompose the object into fields and store them as rows/columns in a relational database. Queryable and debuggable.&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Entity Beans use ORM (not serialization) for persistence.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Mechanism&lt;/th&gt;&lt;th&gt;How&lt;/th&gt;&lt;th&gt;Pros&lt;/th&gt;&lt;th&gt;Cons&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Serialization&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code class=&quot;notranslate&quot;&gt;ObjectOutputStream&lt;/code&gt; → byte blob&lt;/td&gt;&lt;td&gt;Simple, built-in&lt;/td&gt;&lt;td&gt;Not queryable, hard to debug&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;ORM&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Map fields → table columns&lt;/td&gt;&lt;td&gt;Queryable, standard SQL&lt;/td&gt;&lt;td&gt;More complex setup&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Object DB&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Store as native object&lt;/td&gt;&lt;td&gt;No mapping needed&lt;/td&gt;&lt;td&gt;Not widely adopted&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: Persistence Pages: 1 --&gt;
&lt;svg width=&quot;501pt&quot; height=&quot;213pt&quot; viewBox=&quot;0.00 0.00 501.00 213.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 209)&quot;&gt;
&lt;title&gt;Persistence&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-209 496.59,-209 496.59,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_ser&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;352.14,-114 352.14,-197 454.87,-197 454.87,-114 352.14,-114&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.51&quot; y=&quot;-180.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Serialization&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_orm&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;319.22,-8 319.22,-106 488.79,-106 488.79,-8 319.22,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;404.01&quot; y=&quot;-89.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Object-Relational Mapping&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Obj --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Obj&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;175.36,-113.8 0,-113.8 0,-72.2 175.36,-72.2 175.36,-113.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;87.68&quot; y=&quot;-97.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;BankAccount Object&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;87.68&quot; y=&quot;-80.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(accountID, owner, balance)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Blob --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Blob&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;446.87,-163.8 360.14,-163.8 360.14,-122.2 446.87,-122.2 446.87,-163.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.51&quot; y=&quot;-147.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Byte Blob&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.51&quot; y=&quot;-130.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(unreadable)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Obj&amp;#45;&amp;gt;Blob --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Obj-&gt;Blob&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M175.71,-110.87C181.68,-111.97 187.6,-113.02 193.36,-114 246,-122.92 306.44,-131.08 348.77,-136.45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;348.07,-139.89 358.43,-137.67 348.95,-132.95 348.07,-139.89&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;251.29&quot; y=&quot;-135.18&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ObjectOutputStream&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Table --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Table&lt;/title&gt;
&lt;path fill=&quot;lightyellow&quot; stroke=&quot;black&quot; d=&quot;M476.59,-68.4C476.59,-71.27 443.83,-73.6 403.51,-73.6 363.18,-73.6 330.42,-71.27 330.42,-68.4 330.42,-68.4 330.42,-21.6 330.42,-21.6 330.42,-18.73 363.18,-16.4 403.51,-16.4 443.83,-16.4 476.59,-18.73 476.59,-21.6 476.59,-21.6 476.59,-68.4 476.59,-68.4&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M476.59,-68.4C476.59,-65.53 443.83,-63.2 403.51,-63.2 363.18,-63.2 330.42,-65.53 330.42,-68.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.51&quot; y=&quot;-49.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;BankAccount Table&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;403.51&quot; y=&quot;-32.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;| ID | Owner | Balance |&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Obj&amp;#45;&amp;gt;Table --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Obj-&gt;Table&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M157.52,-71.72C169.38,-68.61 181.66,-65.74 193.36,-63.6 234.32,-56.09 280.36,-51.58 318.8,-48.89&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;318.7,-52.4 328.44,-48.24 318.23,-45.42 318.7,-52.4&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;251.29&quot; y=&quot;-101.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;JDBC/ORM&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;251.29&quot; y=&quot;-84.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(accountID→col1,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;251.29&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;owner→col2, etc.)&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Entity Beans use ORM&lt;/strong&gt;: They map to relational database tables (not serialization)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EJB doesn’t dictate ORM tool&lt;/strong&gt;: You can use JDBC (BMP) or container-managed (CMP)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern tools&lt;/strong&gt;: Hibernate, TopLink, JDO—automate ORM (popular in EJB 3.x+)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Queryable&lt;/strong&gt;: Unlike serialization, ORM lets you run SQL queries like “find all accounts with balance &gt; $1000”&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../object-relational-mapping&quot; class=&quot;internal alias&quot; data-slug=&quot;object-relational-mapping&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Object-Relational Mapping&lt;/a&gt;, &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../bean-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;bean-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Bean-Managed Persistence&lt;/a&gt; (JDBC), &lt;a href=&quot;../../container-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;container-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Container-Managed Persistence&lt;/a&gt; (auto)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt; (API for ORM implementation)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Session beans (non-persistent, RAM-only)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Serialization is easier but limiting&lt;/strong&gt;: Good for simple caching, bad for business data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ORM has a learning curve&lt;/strong&gt;: Mapping complex object relationships to tables requires skill&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JDO (Java Data Objects)&lt;/strong&gt;: Alternative to EJB entity beans for persistence (portable across databases)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>primary-key</title>
    <link href="https://animishraa05.github.io/wiki/ejb/primary-key" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/primary-key.md" />
    <summary>The Problem In databases, we need a way to uniquely identify each row/record.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="database" label="database" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;In databases, we need a way to uniquely identify each row/record. Without a unique identifier, we can’t reliably update, delete, or reference specific records. Multiple records might have identical data but represent different entities.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A primary key is a column (or set of columns) whose values uniquely identify each row in a database table. In EJB entity beans, the primary key is wrapped in a PrimaryKeyClass object that the container uses for identity management.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;In relational databases:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Uniqueness&lt;/strong&gt; — no two rows can have the same primary key value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Non-null&lt;/strong&gt; — primary key cannot be NULL&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Immutable&lt;/strong&gt; — once set, primary key shouldn’t change&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;In EJB Entity Beans:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;PrimaryKeyClass&lt;/strong&gt; — wrapper class implementing Serializable and optionally hashCode/equals&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;getPrimaryKey()&lt;/strong&gt; — method to retrieve current entity’s primary key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Finder methods&lt;/strong&gt; — return primary keys to locate entities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container uses PK&lt;/strong&gt; — for pooling, identity, and relationship management&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;453pt&quot; height=&quot;152pt&quot; viewBox=&quot;0.00 0.00 453.00 152.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 148)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-148 449.03,-148 449.03,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Entity Bean Instance --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Entity Bean Instance&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M120.63,-36C120.63,-36 12,-36 12,-36 6,-36 0,-30 0,-24 0,-24 0,-12 0,-12 0,-6 6,0 12,0 12,0 120.63,0 120.63,0 126.63,0 132.63,-6 132.63,-12 132.63,-12 132.63,-24 132.63,-24 132.63,-30 126.63,-36 120.63,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;66.31&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Entity Bean Instance&lt;/text&gt;
&lt;/g&gt;
&lt;!-- PrimaryKeyClass --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;PrimaryKeyClass&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M277.81,-36C277.81,-36 187.05,-36 187.05,-36 181.05,-36 175.05,-30 175.05,-24 175.05,-24 175.05,-12 175.05,-12 175.05,-6 181.05,0 187.05,0 187.05,0 277.81,0 277.81,0 283.81,0 289.81,-6 289.81,-12 289.81,-12 289.81,-24 289.81,-24 289.81,-30 283.81,-36 277.81,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;232.43&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;PrimaryKeyClass&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Entity Bean Instance&amp;#45;&amp;gt;PrimaryKeyClass --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Entity Bean Instance-&gt;PrimaryKeyClass&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M133.12,-18C142.99,-18 153.19,-18 163.11,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;163.08,-21.5 173.08,-18 163.08,-14.5 163.08,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- primaryKey field --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;primaryKey field&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M433.03,-36C433.03,-36 344.23,-36 344.23,-36 338.23,-36 332.23,-30 332.23,-24 332.23,-24 332.23,-12 332.23,-12 332.23,-6 338.23,0 344.23,0 344.23,0 433.03,0 433.03,0 439.03,0 445.03,-6 445.03,-12 445.03,-12 445.03,-24 445.03,-24 445.03,-30 439.03,-36 433.03,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;388.63&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;primaryKey field&lt;/text&gt;
&lt;/g&gt;
&lt;!-- PrimaryKeyClass&amp;#45;&amp;gt;primaryKey field --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;PrimaryKeyClass-&gt;primaryKey field&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M289.97,-18C299.9,-18 310.32,-18 320.51,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;320.35,-21.5 330.35,-18 320.35,-14.5 320.35,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Finder Method --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Finder Method&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M104.12,-90C104.12,-90 28.51,-90 28.51,-90 22.51,-90 16.51,-84 16.51,-78 16.51,-78 16.51,-66 16.51,-66 16.51,-60 22.51,-54 28.51,-54 28.51,-54 104.12,-54 104.12,-54 110.12,-54 116.12,-60 116.12,-66 116.12,-66 116.12,-78 116.12,-78 116.12,-84 110.12,-90 104.12,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;66.31&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Finder Method&lt;/text&gt;
&lt;/g&gt;
&lt;!-- returns PrimaryKey --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;returns PrimaryKey&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M283.83,-90C283.83,-90 181.03,-90 181.03,-90 175.03,-90 169.03,-84 169.03,-78 169.03,-78 169.03,-66 169.03,-66 169.03,-60 175.03,-54 181.03,-54 181.03,-54 283.83,-54 283.83,-54 289.83,-54 295.83,-60 295.83,-66 295.83,-66 295.83,-78 295.83,-78 295.83,-84 289.83,-90 283.83,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;232.43&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;returns PrimaryKey&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Finder Method&amp;#45;&amp;gt;returns PrimaryKey --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Finder Method-&gt;returns PrimaryKey&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M116.55,-72C129.39,-72 143.51,-72 157.32,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;157.3,-75.5 167.3,-72 157.3,-68.5 157.3,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Container --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Container&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M89.92,-144C89.92,-144 42.71,-144 42.71,-144 36.71,-144 30.71,-138 30.71,-132 30.71,-132 30.71,-120 30.71,-120 30.71,-114 36.71,-108 42.71,-108 42.71,-108 89.92,-108 89.92,-108 95.92,-108 101.92,-114 101.92,-120 101.92,-120 101.92,-132 101.92,-132 101.92,-138 95.92,-144 89.92,-144&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;66.31&quot; y=&quot;-121.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Container&lt;/text&gt;
&lt;/g&gt;
&lt;!-- uses PK for identity --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;uses PK for identity&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M284.23,-144C284.23,-144 180.63,-144 180.63,-144 174.63,-144 168.63,-138 168.63,-132 168.63,-132 168.63,-120 168.63,-120 168.63,-114 174.63,-108 180.63,-108 180.63,-108 284.23,-108 284.23,-108 290.23,-108 296.23,-114 296.23,-120 296.23,-120 296.23,-132 296.23,-132 296.23,-138 290.23,-144 284.23,-144&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;232.43&quot; y=&quot;-121.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;uses PK for identity&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Container&amp;#45;&amp;gt;uses PK for identity --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Container-&gt;uses PK for identity&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M102.12,-126C118.09,-126 137.68,-126 156.74,-126&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;156.67,-129.5 166.67,-126 156.67,-122.5 156.67,-129.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Unique identification&lt;/strong&gt; — each entity instance has distinct primary key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Serializable&lt;/strong&gt; — PrimaryKeyClass must implement java.io.Serializable&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simple or composite&lt;/strong&gt; — single field or multiple fields combined&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container-managed&lt;/strong&gt; — EJB container tracks entities by primary key&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt; — entity beans use primary keys for identity&lt;/li&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../entity-bean-identity&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean-identity&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean Identity&lt;/a&gt; — PK defines entity identity&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../finder-methods&quot; class=&quot;internal alias&quot; data-slug=&quot;finder-methods&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Finder Methods&lt;/a&gt; — return primary keys&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../getprimarykey&quot; class=&quot;internal alias&quot; data-slug=&quot;getprimarykey&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;getPrimaryKey()&lt;/a&gt; — method to retrieve PK&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../primary-key-class&quot; class=&quot;internal alias&quot; data-slug=&quot;primary-key-class&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Primary Key Class&lt;/a&gt; — wrapper class for PK&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt; — SQL uses primary keys for WHERE clauses&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Composite keys&lt;/strong&gt; — need custom PrimaryKeyClass with proper equals() and hashCode()&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto-generated keys&lt;/strong&gt; — database can generate (e.g., AUTO_INCREMENT), must sync to bean&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Changing PK&lt;/strong&gt; — don’t change primary key after creation; it breaks identity&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>resource-pooling</title>
    <link href="https://animishraa05.github.io/wiki/ejb/resource-pooling" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/resource-pooling.md" />
    <summary>The Problem Creating expensive resources like database connections, socket connections, or threads for each client request is inefficient.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="performance" label="performance" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Creating expensive resources like database connections, socket connections, or threads for each client request is inefficient. These resources take time to create and are limited. How can we reuse them efficiently?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Resource pooling is the practice of maintaining a pool of ready-to-use resources (DB connections, sockets, threads) that are shared across clients. When a client needs a resource, it’s taken from the pool; when done, it’s returned for reuse.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Pool creation&lt;/strong&gt;: Container pre-creates N connections (e.g., 50 DB connections)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client request&lt;/strong&gt;: Client needs DB access → gets connection from pool&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Usage&lt;/strong&gt;: Client uses connection for SQL operations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Return&lt;/strong&gt;: Connection returned to pool (not closed/destroyed)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reuse&lt;/strong&gt;: Next client gets the same connection&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;JDBC drivers, JMS connection factories, and EJB instances all use pooling.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;547pt&quot; height=&quot;165pt&quot; viewBox=&quot;0.00 0.00 547.00 165.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 161)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-161 542.71,-161 542.71,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client A --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client A&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;63.83,-103 0,-103 0,-67 63.83,-67 63.83,-103&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.92&quot; y=&quot;-80.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client A&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Pool --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Pool&lt;/title&gt;
&lt;path fill=&quot;lightyellow&quot; stroke=&quot;black&quot; d=&quot;M317.62,-81.4C317.62,-84.27 287.19,-86.6 249.74,-86.6 212.28,-86.6 181.86,-84.27 181.86,-81.4 181.86,-81.4 181.86,-34.6 181.86,-34.6 181.86,-31.73 212.28,-29.4 249.74,-29.4 287.19,-29.4 317.62,-31.73 317.62,-34.6 317.62,-34.6 317.62,-81.4 317.62,-81.4&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M317.62,-81.4C317.62,-78.53 287.19,-76.2 249.74,-76.2 212.28,-76.2 181.86,-78.53 181.86,-81.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;249.74&quot; y=&quot;-62.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Resource Pool&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;249.74&quot; y=&quot;-45.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(50 DB Connections)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client A&amp;#45;&amp;gt;Pool --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client A-&gt;Pool&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M64.26,-84.08C90.87,-83.01 130,-80.73 163.86,-76 166.04,-75.7 168.25,-75.37 170.47,-75.02&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;170.94,-78.49 180.22,-73.37 169.77,-71.59 170.94,-78.49&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;122.84&quot; y=&quot;-87.41&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;get connection&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client A&amp;#45;&amp;gt;Pool --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client A-&gt;Pool&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M57.33,-66.55C64.8,-61.92 73.31,-57.59 81.83,-55.2 109.91,-47.32 141.71,-46.07 169.96,-47.45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;169.71,-50.94 179.9,-48.07 170.14,-43.96 169.71,-50.94&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;122.84&quot; y=&quot;-59.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;return&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client B --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client B&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;63.44,-36 0.39,-36 0.39,0 63.44,0 63.44,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.92&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client B&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client B&amp;#45;&amp;gt;Pool --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client B-&gt;Pool&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M63.69,-17.38C90.45,-17.44 130.11,-18.99 163.86,-26.2 166.62,-26.79 169.41,-27.45 172.21,-28.18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;171.01,-31.47 181.58,-30.83 172.91,-24.74 171.01,-31.47&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;122.84&quot; y=&quot;-30.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;get connection&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client C --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client C&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;63.44,-157 0.39,-157 0.39,-121 63.44,-121 63.44,-157&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.92&quot; y=&quot;-134.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client C&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DB Connection 1 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DB Connection 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M422.41,-104C422.41,-104 366.62,-104 366.62,-104 360.62,-104 354.62,-98 354.62,-92 354.62,-92 354.62,-80 354.62,-80 354.62,-74 360.62,-68 366.62,-68 366.62,-68 422.41,-68 422.41,-68 428.41,-68 434.41,-74 434.41,-80 434.41,-80 434.41,-92 434.41,-92 434.41,-98 428.41,-104 422.41,-104&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;394.51&quot; y=&quot;-81.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;DB Conn 1&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Pool&amp;#45;&amp;gt;DB Connection 1 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Pool-&gt;DB Connection 1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M317.95,-71.18C326.4,-72.84 334.94,-74.51 343.07,-76.11&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;342.29,-79.52 352.77,-78.01 343.63,-72.65 342.29,-79.52&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- DB Connection 2 --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DB Connection 2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M422.41,-50C422.41,-50 366.62,-50 366.62,-50 360.62,-50 354.62,-44 354.62,-38 354.62,-38 354.62,-26 354.62,-26 354.62,-20 360.62,-14 366.62,-14 366.62,-14 422.41,-14 422.41,-14 428.41,-14 434.41,-20 434.41,-26 434.41,-26 434.41,-38 434.41,-38 434.41,-44 428.41,-50 422.41,-50&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;394.51&quot; y=&quot;-27.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;DB Conn 2&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Pool&amp;#45;&amp;gt;DB Connection 2 --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Pool-&gt;DB Connection 2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M317.95,-45.76C326.4,-44.22 334.94,-42.67 343.07,-41.19&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;343.56,-44.65 352.77,-39.42 342.3,-37.77 343.56,-44.65&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Database --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Database&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M538.71,-72.73C538.71,-74.53 523.63,-76 505.06,-76 486.49,-76 471.41,-74.53 471.41,-72.73 471.41,-72.73 471.41,-43.27 471.41,-43.27 471.41,-41.47 486.49,-40 505.06,-40 523.63,-40 538.71,-41.47 538.71,-43.27 538.71,-43.27 538.71,-72.73 538.71,-72.73&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M538.71,-72.73C538.71,-70.92 523.63,-69.45 505.06,-69.45 486.49,-69.45 471.41,-70.92 471.41,-72.73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;505.06&quot; y=&quot;-53.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Database&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DB Connection 1&amp;#45;&amp;gt;Database --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;DB Connection 1-&gt;Database&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M434.7,-75.89C442.88,-73.78 451.56,-71.54 459.91,-69.39&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;460.74,-72.79 469.55,-66.9 458.99,-66.01 460.74,-72.79&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- DB Connection 2&amp;#45;&amp;gt;Database --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;DB Connection 2-&gt;Database&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M434.7,-41.39C442.88,-43.35 451.56,-45.43 459.91,-47.43&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;459,-50.81 469.54,-49.73 460.63,-44 459,-50.81&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Expensive resources&lt;/strong&gt;: DB connections, sockets, threads are pooled&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container-managed&lt;/strong&gt;: EJB container manages resource pools&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enormous efficiency&lt;/strong&gt;: Same connection serves many clients&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared by beans&lt;/strong&gt;: Entity beans, session beans share DB connection pool&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configurable&lt;/strong&gt;: Pool min/max size set in container config&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../instance-pooling&quot; class=&quot;internal alias&quot; data-slug=&quot;instance-pooling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Instance Pooling&lt;/a&gt; — bean pooling is one type of resource pooling&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt; — JDBC connections are pooled&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jms&quot; class=&quot;internal alias&quot; data-slug=&quot;jms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JMS&lt;/a&gt; — JMS connections also pooled&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — container manages resource pools&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Leaked connections&lt;/strong&gt;: Forgetting to close() returns connection to pool&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pool exhaustion&lt;/strong&gt;: All connections busy → clients wait or fail&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transaction scope&lt;/strong&gt;: Connection must remain same within transaction&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pool sizing&lt;/strong&gt;: Too small = wait; too large = waste memory&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>rmi-iiop</title>
    <link href="https://animishraa05.github.io/wiki/ejb/rmi-iiop" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/rmi-iiop.md" />
    <summary>The Problem RMI (Remote Method Invocation) originally used JRMP (Java Remote Method Protocol), which only works between Java objects.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="rmi" label="rmi" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;RMI (Remote Method Invocation) originally used JRMP (Java Remote Method Protocol), which only works between Java objects. To integrate with CORBA (cross-language), we need RMI to use IIOP (Internet Inter-ORB Protocol) as its transport.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;RMI-IIOP is RMI extended to use the IIOP protocol, enabling CORBA integration. It’s the official API used in J2EE (not plain RMI). EJB objects are fully networked RMI-IIOP objects callable from other JVMs.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;EJB Object&lt;/strong&gt;: Implements &lt;code class=&quot;notranslate&quot;&gt;javax.ejb.EJBObject&lt;/code&gt; which extends &lt;code class=&quot;notranslate&quot;&gt;java.rmi.Remote&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RMI-IIOP&lt;/strong&gt;: Uses IIOP protocol instead of JRMP&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remote exceptions&lt;/strong&gt;: All remote methods must throw &lt;code class=&quot;notranslate&quot;&gt;java.rmi.RemoteException&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parameter passing&lt;/strong&gt;: Primitives, serializable objects, RMI-IIOP remote objects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CORBA integration&lt;/strong&gt;: Can interoperate with CORBA objects via IIOP&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Appendix A covers RMI-IIOP in detail.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;509pt&quot; height=&quot;44pt&quot; viewBox=&quot;0.00 0.00 509.00 44.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 40)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-40 504.71,-40 504.71,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client JVM --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client JVM&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;81.73,-36 0,-36 0,0 81.73,0 81.73,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;40.86&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client JVM&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Object --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJB Object&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;254.25,-36 176.06,-18 254.25,0 332.44,-18 254.25,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;254.25&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Object&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client JVM&amp;#45;&amp;gt;EJB Object --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client JVM-&gt;EJB Object&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M82.12,-18C105.07,-18 134.8,-18 163.03,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;162.66,-21.5 172.66,-18 162.66,-14.5 162.66,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;128.89&quot; y=&quot;-22.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;RMI-IIOP&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CORBA Object --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CORBA Object&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;500.71,-36 395.66,-36 395.66,0 500.71,0 500.71,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;448.19&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CORBA Object&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Object&amp;#45;&amp;gt;CORBA Object --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;EJB Object-&gt;CORBA Object&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M334.43,-18C350.96,-18 368.19,-18 384.05,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;383.81,-21.5 393.81,-18 383.81,-14.5 383.81,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;364.05&quot; y=&quot;-22.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IIOP&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;IIOP protocol&lt;/strong&gt;: Standard CORBA wire protocol&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Official J2EE&lt;/strong&gt;: Used instead of plain RMI in J2EE&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RemoteException&lt;/strong&gt;: All remote methods must declare this&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parameter rules&lt;/strong&gt;: Only certain types can be passed (primitives, serializable, remote objects)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CORBA compatible&lt;/strong&gt;: Enables cross-language calls&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../rmi-remote-method-invocation&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-remote-method-invocation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI&lt;/a&gt; — RMI-IIOP extends RMI&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-object&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-object&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Object&lt;/a&gt; — EJB objects are RMI-IIOP objects&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../java-idl&quot; class=&quot;internal alias&quot; data-slug=&quot;java-idl&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java IDL&lt;/a&gt; — Java IDL also uses CORBA/IIOP&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../distributed-objects&quot; class=&quot;internal alias&quot; data-slug=&quot;distributed-objects&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Distributed Objects&lt;/a&gt; — RMI-IIOP enables distributed Java objects&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../rmi-registry&quot; class=&quot;internal alias&quot; data-slug=&quot;rmi-registry&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;RMI Registry&lt;/a&gt; — RMI-IIOP uses IIOP, not JRMP&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Parameter restrictions&lt;/strong&gt;: Not all objects can be passed (must be serializable or remote)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RemoteException&lt;/strong&gt;: Forgetting to declare it causes compile error&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Firewall issues&lt;/strong&gt;: IIOP may be blocked (use HTTP tunneling if needed)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Appendix A&lt;/strong&gt;: See full RMI-IIOP details there&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>serialization-vs-orm</title>
    <link href="https://animishraa05.github.io/wiki/ejb/serialization-vs-orm" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/serialization-vs-orm.md" />
    <summary>The Problem You need to save a Java object permanently.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="database" label="database" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;You need to save a Java object permanently. Should you serialize it to a byte stream, or map it to a relational database? What are the trade-offs?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;








































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Aspect&lt;/th&gt;&lt;th&gt;Serialization&lt;/th&gt;&lt;th&gt;ORM (Object-Relational Mapping)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Storage format&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Byte blob (unreadable)&lt;/td&gt;&lt;td&gt;Relational table (readable)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Querying&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Cannot query (must deserialize everything)&lt;/td&gt;&lt;td&gt;Full SQL queries (&lt;code class=&quot;notranslate&quot;&gt;SELECT * WHERE balance &gt; 1000&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Debugging&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Hard (blob is unreadable)&lt;/td&gt;&lt;td&gt;Easy (inspect table with SQL)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Tooling&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Built into Java (&lt;code class=&quot;notranslate&quot;&gt;Serializable&lt;/code&gt;)&lt;/td&gt;&lt;td&gt;Requires ORM tool (Hibernate, TopLink, JDBC)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Fast for single objects&lt;/td&gt;&lt;td&gt;Better for large datasets (indexed queries)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;EJB Entity Beans&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Not used&lt;/td&gt;&lt;td&gt;Used (JDBC for BMP, container for CMP)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Serialization approach:&lt;/strong&gt;&lt;/p&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// Save&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ObjectOutputStream oos &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; ObjectOutputStream&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; FileOutputStream&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;account.dat&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;oos.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;writeObject&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(bankAccount);&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// Load&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ObjectInputStream ois &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; ObjectInputStream&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; FileInputStream&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;account.dat&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;BankAccount account &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (BankAccount) ois.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;readObject&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;ORM approach:&lt;/strong&gt;&lt;/p&gt;
&lt;figure data-rehype-pretty-code-figure=&quot;&quot;&gt;&lt;pre style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code data-language=&quot;java&quot; data-theme=&quot;github-light github-dark&quot; style=&quot;display: grid;&quot; class=&quot;notranslate&quot;&gt;&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// Save (BMP style with JDBC)&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;PreparedStatement ps &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; conn.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;prepareStatement&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;INSERT INTO accounts (id, owner, balance) VALUES (?, ?, ?)&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ps.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;setString&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, account.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;getAccountID&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ps.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;setString&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, account.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;getOwnerName&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ps.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;setDouble&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, account.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;getBalance&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span data-line=&quot;&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ps.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;executeUpdate&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: SerVsORM Pages: 1 --&gt;
&lt;svg width=&quot;968pt&quot; height=&quot;204pt&quot; viewBox=&quot;0.00 0.00 968.00 204.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 200.2)&quot;&gt;
&lt;title&gt;SerVsORM&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-200.2 964,-200.2 964,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;g id=&quot;clust1&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_ser&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;8,-38.9 8,-121.3 406,-121.3 406,-38.9 8,-38.9&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;207&quot; y=&quot;-104.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Serialization&lt;/text&gt;
&lt;/g&gt;
&lt;g id=&quot;clust2&quot; class=&quot;cluster&quot;&gt;
&lt;title&gt;cluster_orm&lt;/title&gt;
&lt;polygon fill=&quot;none&quot; stroke=&quot;black&quot; points=&quot;414,-8 414,-152.2 952,-152.2 952,-8 414,-8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;683&quot; y=&quot;-135.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ORM&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Obj --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Obj&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;353.9,-196.2 220.1,-196.2 220.1,-160.2 353.9,-160.2 353.9,-196.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;287&quot; y=&quot;-174&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;BankAccount Object&lt;/text&gt;
&lt;/g&gt;
&lt;!-- SerFile --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;SerFile&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;142.39,-88.5 15.61,-88.5 15.61,-46.9 142.39,-46.9 142.39,-88.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;79&quot; y=&quot;-71.9&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;account.dat&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;79&quot; y=&quot;-55.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;[byte][byte][byte]...&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Obj&amp;#45;&amp;gt;SerFile --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Obj-&gt;SerFile&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M219.9,-173.91C196.88,-170.5 171.72,-164.08 151,-152.2 128.48,-139.29 109.61,-116.62 96.85,-98.16&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;99.85,-96.36 91.41,-89.96 94.02,-100.22 99.85,-96.36&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Table --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Table&lt;/title&gt;
&lt;path fill=&quot;lightyellow&quot; stroke=&quot;black&quot; d=&quot;M568.08,-110C568.08,-115.19 535.33,-119.4 495,-119.4 454.67,-119.4 421.92,-115.19 421.92,-110 421.92,-110 421.92,-25.4 421.92,-25.4 421.92,-20.21 454.67,-16 495,-16 535.33,-16 568.08,-20.21 568.08,-25.4 568.08,-25.4 568.08,-110 568.08,-110&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M568.08,-110C568.08,-104.81 535.33,-100.6 495,-100.6 454.67,-100.6 421.92,-104.81 421.92,-110&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;495&quot; y=&quot;-88.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;accounts table&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;495&quot; y=&quot;-71.9&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;| ID | Owner | Balance |&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;495&quot; y=&quot;-55.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;| 1 | Ray | 1000 |&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;495&quot; y=&quot;-38.3&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;| 2 | Bob | 1500 |&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Obj&amp;#45;&amp;gt;Table --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Obj-&gt;Table&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M354.19,-170.72C373.02,-167.03 392.97,-161.25 410,-152.2 422.4,-145.61 434.19,-136.65 444.84,-127.03&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;447.15,-129.67 452.01,-120.26 442.34,-124.58 447.15,-129.67&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- SerQ --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;SerQ&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;397.8,-88.5 160.2,-88.5 160.2,-46.9 397.8,-46.9 397.8,-88.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;279&quot; y=&quot;-71.9&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Query: &#039;Find balance &gt; 1000&#039;&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;279&quot; y=&quot;-55.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Answer: Must deserialize ALL objects!&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ORMQ --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ORMQ&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;944.14,-88.5 585.86,-88.5 585.86,-46.9 944.14,-46.9 944.14,-88.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;765&quot; y=&quot;-71.9&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Query: SELECT * FROM accounts WHERE balance &gt; 1000&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;765&quot; y=&quot;-55.1&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Answer: Bob (1500)!&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;ORM is superior for business data&lt;/strong&gt;: Queryability and debuggability win for enterprise apps&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Serialization still useful&lt;/strong&gt;: For caching, session replication in clusters, simple use cases&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Entity beans mandate ORM&lt;/strong&gt;: The EJB spec envisions ORM (not serialization) for entity beans&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern ORM tools&lt;/strong&gt;: Hibernate (most popular), TopLink, JDO—reduce manual JDBC code&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../persistence-concepts&quot; class=&quot;internal alias&quot; data-slug=&quot;persistence-concepts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Persistence Concepts&lt;/a&gt;, &lt;a href=&quot;../../object-relational-mapping&quot; class=&quot;internal alias&quot; data-slug=&quot;object-relational-mapping&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Object-Relational Mapping&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt; (uses ORM, not serialization)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../jdbc&quot; class=&quot;internal alias&quot; data-slug=&quot;jdbc&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JDBC&lt;/a&gt; (API for ORM in BMP), &lt;a href=&quot;../../bean-managed-persistence&quot; class=&quot;internal alias&quot; data-slug=&quot;bean-managed-persistence&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;BMP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; Direct database access (no objects—just SQL)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Serialization version UID&lt;/strong&gt;: If you change the class, deserialization fails without &lt;code class=&quot;notranslate&quot;&gt;serialVersionUID&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ORM impedance mismatch&lt;/strong&gt;: Object model ≠ relational model (inheritance, collections are hard to map)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EJB 3.x uses JPA&lt;/strong&gt;: Java Persistence API—modern evolution of EJB entity beans + ORM&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>servlets</title>
    <link href="https://animishraa05.github.io/wiki/ejb/servlets" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/servlets.md" />
    <summary>The Problem Web servers need to dynamically generate responses (HTML, JSON) based on client requests. Static HTML files aren’t enough.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-05-13T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>May 13, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="web" label="web" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Web servers need to dynamically generate responses (HTML, JSON) based on client requests. Static HTML files aren’t enough. How do we extend web server functionality to handle dynamic requests?&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Servlets are networked components that extend web server functionality. They are request/response-oriented: take HTTP requests from clients (browsers), process them, and issue responses back. Ideal for web tasks like rendering HTML interfaces.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;HTTP request&lt;/strong&gt;: Browser sends request to web server&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Servlet container&lt;/strong&gt;: Web server delegates to servlet (e.g., Tomcat)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lifecycle&lt;/strong&gt;: Container loads servlet class → calls &lt;code class=&quot;notranslate&quot;&gt;init()&lt;/code&gt; (once) → &lt;code class=&quot;notranslate&quot;&gt;service()&lt;/code&gt; (per request) → &lt;code class=&quot;notranslate&quot;&gt;destroy()&lt;/code&gt; (once)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service method&lt;/strong&gt;: &lt;code class=&quot;notranslate&quot;&gt;doGet()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;doPost()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;doPut()&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;doDelete()&lt;/code&gt; handle the request&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filters&lt;/strong&gt;: Intercept requests before they reach the servlet for logging, authentication, compression&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Response generation&lt;/strong&gt;: Servlet writes HTML/JSON to response&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EJB integration&lt;/strong&gt;: Servlets can look up and call EJB components&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Servlets differ from EJBs: no declarative transactions, simpler management by container.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;667pt&quot; height=&quot;81pt&quot; viewBox=&quot;0.00 0.00 667.00 81.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 77)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-77 663.18,-77 663.18,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Browser --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Browser&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;63.43,-36 0,-36 0,0 63.43,0 63.43,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.72&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Web Server --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Web Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M251.34,-73C251.34,-73 192.87,-73 192.87,-73 186.87,-73 180.87,-67 180.87,-61 180.87,-61 180.87,-49 180.87,-49 180.87,-43 186.87,-37 192.87,-37 192.87,-37 251.34,-37 251.34,-37 257.34,-37 263.34,-43 263.34,-49 263.34,-49 263.34,-61 263.34,-61 263.34,-67 257.34,-73 251.34,-73&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;222.11&quot; y=&quot;-50.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Web Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser&amp;#45;&amp;gt;Web Server --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Browser-&gt;Web Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M63.83,-24.11C92.46,-29.73 135.5,-38.19 169.32,-44.83&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;168.43,-48.22 178.91,-46.71 169.78,-41.35 168.43,-48.22&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;120.9&quot; y=&quot;-47.23&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTTP request&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Servlet --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Servlet&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;408.22,-36 353.93,-18 408.22,0 462.51,-18 408.22,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;408.22&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Servlet&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Web Server&amp;#45;&amp;gt;Servlet --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Web Server-&gt;Servlet&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M263.51,-46.88C292.61,-41.03 331.89,-33.14 362.03,-27.08&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;362.49,-30.56 371.61,-25.16 361.11,-23.7 362.49,-30.56&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;309.89&quot; y=&quot;-46.18&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;delegates&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Servlet&amp;#45;&amp;gt;Browser --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Servlet-&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M361.08,-15.22C333.47,-13.7 297.66,-11.96 265.85,-11.2 226.98,-10.27 217.23,-10.29 178.36,-11.2 143.55,-12.01 104.1,-13.91 75.05,-15.5&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;74.97,-12 65.18,-16.05 75.36,-18.99 74.97,-12&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;222.11&quot; y=&quot;-15.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTTP response&lt;/text&gt;
&lt;/g&gt;
&lt;!-- EJB Component --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;EJB Component&lt;/title&gt;
&lt;polygon fill=&quot;lightyellow&quot; stroke=&quot;black&quot; points=&quot;659.18,-36 551.01,-36 551.01,0 659.18,0 659.18,-36&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;605.09&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;EJB Component&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Servlet&amp;#45;&amp;gt;EJB Component --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Servlet-&gt;EJB Component&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M464.02,-18C487.44,-18 514.96,-18 539.37,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;539.2,-21.5 549.2,-18 539.2,-14.5 539.2,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;506.76&quot; y=&quot;-22.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;calls EJB&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Request/response&lt;/strong&gt;: Handles HTTP requests and generates responses&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Web tier&lt;/strong&gt;: Part of presentation layer in J2EE&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lifecycle&lt;/strong&gt;: init() (once) → service() (per request) → destroy() (once)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Session management&lt;/strong&gt;: HttpSession API for maintaining user state across requests&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filters&lt;/strong&gt;: Servlet Filters for cross-cutting concerns (logging, auth, compression)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No EJB features&lt;/strong&gt;: Lacks declarative transactions, sophisticated container management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simpler&lt;/strong&gt;: Better for simple request/response needs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compiled to&lt;/strong&gt;: JSP scripts compile into servlets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;J2EE standard&lt;/strong&gt;: Part of J2EE platform&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Built from: &lt;a href=&quot;../../java-platforms&quot; class=&quot;internal alias&quot; data-slug=&quot;java-platforms&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Java Platforms&lt;/a&gt; — Servlets are part of J2EE&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jsp&quot; class=&quot;internal alias&quot; data-slug=&quot;jsp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JSP&lt;/a&gt; — JSP compiles to servlets&lt;/li&gt;
&lt;li&gt;Builds into: &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; — servlets can call EJBs&lt;/li&gt;
&lt;li&gt;Related: &lt;a href=&quot;../../jsp&quot; class=&quot;internal alias&quot; data-slug=&quot;jsp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JSP&lt;/a&gt; — JSP is alternative presentation technology&lt;/li&gt;
&lt;li&gt;Contrasts with: &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt; — servlets handle web, EJBs handle business logic&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Thread safety&lt;/strong&gt;: Servlets are shared across requests, must be thread-safe — avoid instance variables&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No transactions&lt;/strong&gt;: Use EJB if you need declarative transactions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Session management&lt;/strong&gt;: Servlets can use HTTP sessions but EJBs shouldn’t&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter ordering&lt;/strong&gt;: Filter execution order follows web.xml declaration order&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;async supported&lt;/strong&gt;: Servlet 3.0+ supports async processing for long-lived connections&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>session-bean-lifetime</title>
    <link href="https://animishraa05.github.io/wiki/ejb/session-bean-lifetime" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/ejb/session-bean-lifetime.md" />
    <summary>The Problem How long does a session bean live? Is it days? Years? Can it survive a server crash? Understanding bean lifetime is crucial for deciding what data to store in a session bean vs a database.</summary>
    <published>2026-04-29T00:00:00.000Z</published>
    <updated>2026-04-29T00:00:00.000Z</updated>
    <publishedTime>Apr 29, 2026</publishedTime>
    <updatedTime>Apr 29, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="ejb" label="ejb" />
<category term="session-bean" label="session-bean" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;How long does a session bean live? Is it days? Years? Can it survive a server crash? Understanding bean lifetime is crucial for deciding what data to store in a session bean vs a database.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Session beans are &lt;strong&gt;short-lived, non-persistent objects&lt;/strong&gt;. Their lifetime is roughly the duration of the client session—when the client disconnects or times out, the container may destroy the bean. Session beans live in RAM and do NOT survive server crashes.&lt;/p&gt;
&lt;p dir=&quot;auto&quot;&gt;Contrast with Entity Beans which can live for months/years (persistent in database).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Client session starts&lt;/strong&gt;: Client calls &lt;code class=&quot;notranslate&quot;&gt;create()&lt;/code&gt; on home interface → container creates bean&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;During session&lt;/strong&gt;: Bean serves the client (could be milliseconds or hours)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client disconnects&lt;/strong&gt;: Bean is destroyed (or returned to pool for stateless)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server crashes&lt;/strong&gt;: ALL session beans are lost (in-memory only)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeout&lt;/strong&gt;: If client is idle too long, container destroys bean&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: SessionLifetime Pages: 1 --&gt;
&lt;svg width=&quot;595pt&quot; height=&quot;124pt&quot; viewBox=&quot;0.00 0.00 595.00 124.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 120.4)&quot;&gt;
&lt;title&gt;SessionLifetime&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-120.4 590.57,-120.4 590.57,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;polygon fill=&quot;lightblue&quot; stroke=&quot;black&quot; points=&quot;102.31,-83 0,-83 0,-24.6 102.31,-24.6 102.31,-83&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;51.16&quot; y=&quot;-66.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client Session&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;51.16&quot; y=&quot;-49.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Browser open,&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;51.16&quot; y=&quot;-32.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;App running)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Bean&lt;/title&gt;
&lt;polygon fill=&quot;lightgreen&quot; stroke=&quot;black&quot; points=&quot;356.1,-74.6 265.05,-74.6 265.05,-33 356.1,-33 356.1,-74.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;310.57&quot; y=&quot;-58&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Session Bean&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;310.57&quot; y=&quot;-41.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(In RAM)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;Bean --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;Bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M102.48,-68.64C108.45,-69.94 114.49,-71.04 120.31,-71.8 176.17,-79.05 191.27,-79.67 247.05,-71.8 249.23,-71.49 251.44,-71.13 253.67,-70.71&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;254.3,-74.16 263.34,-68.63 252.83,-67.32 254.3,-74.16&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;183.68&quot; y=&quot;-81.67&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. create()&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;Bean --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;Bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M102.77,-51.49C108.68,-51.29 114.63,-51.12 120.31,-51 176.63,-49.84 190.73,-49.74 247.05,-51 249.12,-51.05 251.23,-51.1 253.35,-51.16&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;253.21,-54.66 263.33,-51.5 253.45,-47.66 253.21,-54.66&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;183.68&quot; y=&quot;-55.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Business calls&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;Bean --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;Bean&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M102.61,-33.26C108.5,-31.51 114.48,-30.03 120.31,-29 175.78,-19.22 191.72,-18.43 247.05,-29 249.33,-29.44 251.64,-29.96 253.96,-30.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;252.73,-33.83 263.31,-33.28 254.7,-27.11 252.73,-33.83&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;183.68&quot; y=&quot;-33.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. remove() or timeout&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DB --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DB&lt;/title&gt;
&lt;path fill=&quot;lightyellow&quot; stroke=&quot;black&quot; d=&quot;M561.67,-111.2C561.67,-114.07 543.8,-116.4 521.79,-116.4 499.78,-116.4 481.91,-114.07 481.91,-111.2 481.91,-111.2 481.91,-64.4 481.91,-64.4 481.91,-61.53 499.78,-59.2 521.79,-59.2 543.8,-59.2 561.67,-61.53 561.67,-64.4 561.67,-64.4 561.67,-111.2 561.67,-111.2&quot;&gt;&lt;/path&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M561.67,-111.2C561.67,-108.33 543.8,-106 521.79,-106 499.78,-106 481.91,-108.33 481.91,-111.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;521.79&quot; y=&quot;-92&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Database&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;521.79&quot; y=&quot;-75.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(Persistent)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;DB --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Bean-&gt;DB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M356.46,-61.09C389.9,-66.53 435.58,-73.95 470.3,-79.59&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;469.69,-83.04 480.12,-81.19 470.81,-76.13 469.69,-83.04&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;406.56&quot; y=&quot;-94.85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;May access&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;406.56&quot; y=&quot;-78.05&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;database&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Crash --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Crash&lt;/title&gt;
&lt;polygon fill=&quot;lightcoral&quot; stroke=&quot;black&quot; points=&quot;586.57,-41.6 457.01,-41.6 457.01,0 586.57,0 586.57,-41.6&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;521.79&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server Crash!&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;521.79&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Session Bean LOST&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Bean&amp;#45;&amp;gt;Crash --&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Non-persistent&lt;/strong&gt;: Session beans are NOT saved to permanent storage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client-scoped&lt;/strong&gt;: Lifetime tied to client session (not permanent)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container-managed&lt;/strong&gt;: Container decides exactly when to destroy&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RAM-only&lt;/strong&gt;: Live in memory, not on disk&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Session Bean&lt;/a&gt;, &lt;a href=&quot;../../ejb-container&quot; class=&quot;internal alias&quot; data-slug=&quot;ejb-container&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;EJB Container&lt;/a&gt; (manages lifetime)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../stateful-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateful-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateful Session Bean&lt;/a&gt; (dedicated lifetime), &lt;a href=&quot;../../stateless-session-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;stateless-session-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Stateless Session Bean&lt;/a&gt; (pool-based lifetime)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../entity-bean&quot; class=&quot;internal alias&quot; data-slug=&quot;entity-bean&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Entity Bean&lt;/a&gt; (persistent, survives crashes, lives for years)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../passivation&quot; class=&quot;internal alias&quot; data-slug=&quot;passivation&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Passivation&lt;/a&gt; (stateful beans may be temporarily stored to disk)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Don’t store critical data in session beans&lt;/strong&gt;: If server crashes, it’s gone&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stateless beans may be destroyed after EVERY method call&lt;/strong&gt;: Don’t expect data to persist between calls&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeout values are configurable&lt;/strong&gt;: Deployer sets session timeout in vendor-specific config&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
</feed>