Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Doubts : Limitations, Entity Bean, Application Exception

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have few doubts and need your help.

Limitations to the EJB Model


1.Your Bean must not attempt to define a class in a package. (???)
2.Your bean must not use the subclass and object substitution features of serialization protocols. (???)
3.Your bean can�t read/write static fields. (I hope it�s in context of persistence of objects.)

Entity Bean


Version 1.1 of EJB specification allows only one to one mapping between the instance variable and the cols. Of the table. This means that when using this version, if you want to represent an aggregate object in an entity bean that stores its state in multiple tables, you can�t use CMP. This is where BMP comes into picture. (???)

Application Exception


Relating to the executing business logic that the client should be handling. e.g. Invalid input augments. (I hope it's mean that bean will throw the exception and client will handle it; as bean not allowed to perform I/O operations.)
Thanks,
Sanjeev.
[ December 26, 2003: Message edited by: sanjeev mehra ]
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Your Bean must not attempt to define a class in a package. (???)
https://coderanch.com/t/158458/java-EJB-SCBCD/certification/EJB-Programming-restrictions
3. Your bean can�t read/write static fields. (I hope it�s in context of persistence of objects.)
EJB2.0 Specs 24.1.2, p:494
"An enterprise Bean must not use read/write static fields. Using read-only static fields is allowed. Therefore, it is recommended that all static fields in the enterprise bean class be declared as final."
This rule is required to ensure consistent runtime semantics because while some EJB Containers may use a single JVM to execute all enterprise bean�s instances, others may distribute the instances across multiple JVMs.
This is also applicable to helper classes that are used by the bean class.


"Version 1.1 of EJB specification allows only one to one mapping between the instance variable and the cols. Of the table. This means that when using this version, if you want to represent an aggregate object in an entity bean that stores its state in multiple tables, you can�t use CMP. This is where BMP comes into picture. (???)"

-- In EJB1.1, Yes, I think so.....I read somewhere that some vendors of EJB2.0 containers also allow the Entity Bean abstract persistence schema to consist of multiple tables. I am not sure about Views, whether they can be used to insert/update rows.
EJB2.0 CMP is supposed to be better than BMP.
[ December 27, 2003: Message edited by: Vish Kumar ]
 
sanjeev mehra
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.Your bean must not use the subclass and object substitution features of serialization protocols. (???)
[ January 02, 2004: Message edited by: sanjeev mehra ]
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not know the answer, Sanjeev. Hope somebody else answers this...
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sanjeev mehra:
1.Your bean must not use the subclass and object substitution features of serialization protocols. (???)


This could mean that even though the underlying transport would allow custom serialization algorithms, the bean provider must not use such facilities because that would prevent the container vendor from implementing some kind of interceptor/proxy layers between the EJB stub and skeleton. I'm really not sure, though.
 
sanjeev mehra
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vish & Lasse for your help.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic