This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Doubts : Limitations, Entity Bean, Application Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Doubts : Limitations, Entity Bean, Application Exception" Watch "Doubts : Limitations, Entity Bean, Application Exception" New topic
Author

Doubts : Limitations, Entity Bean, Application Exception

sanjeev mehra
Ranch Hand

Joined: Feb 12, 2001
Posts: 93
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 ]
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
1. Your Bean must not attempt to define a class in a package. (???)
http://www.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

Joined: Feb 12, 2001
Posts: 93
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

Joined: Aug 27, 2003
Posts: 1064
I do not know the answer, Sanjeev. Hope somebody else answers this...
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sanjeev mehra
Ranch Hand

Joined: Feb 12, 2001
Posts: 93
Thanks Vish & Lasse for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubts : Limitations, Entity Bean, Application Exception