Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Having both Remote & Local Component interfaces to a Bean?

 
Bhanu
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would appreciate if some one answers the following:-

1) Is it possible to have both the remote & local component interfaces to a Bean( EB/SFSB/SLSB)in the same ejb-jar? If so how to define them in DD.

2) Can CMP filds of EB be primitive?

3) Should EB in EJB 2.0 be CMP & CMT only?

Thanks
Bhanu
 
Sylvain Bouchard
Ranch Hand
Posts: 41
Java ME Objective C Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bhanu,

I'll try to answer all your question.

1) Is it possible to have both the remote & local component interfaces
to a Bean( EB/SFSB/SLSB)in the same ejb-jar? If so how to define them
in DD.


Yes, you can. Here's an example.




2) Can CMP fields of EB be primitive?


Yes, this is from the EJB 2.0 specs.

The Bean Provider must ensure that the Java types assigned to the
cmp-fields are restricted to the following: Java primitive types and Java
serializable types.



3) Should EB in EJB 2.0 be CMP & CMT only?

No, an EB can be CMP or BMT (Bean-Managed Transaction)


When designing an enterprise bean, the Bean Provider must decide whether
the enterprise bean will demarcate transactions programmatically in the
business methods (bean-managed transaction demarcation), or whether the
transaction demarcation is to be performed by the Container based on the
transaction attributes in the deployment descriptor (container-managed
transaction demarcation).


Hope this will help you

Sylvain
SCJP - SCWCD
 
Bhanu
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sylvain!!

But I see the following in the EJB 2.0 Spec, which is hinting that Entity Beans can not be BMT. ( Pg:179 10.5.4)

The getUserTransaction method returns the javax.transaction.UserTransaction
interface. Entity bean instances must not call this method.


[ March 03, 2006: Message edited by: Bhanu P Jasthi ]
[ March 03, 2006: Message edited by: Bhanu P Jasthi ]
 
Sylvain Bouchard
Ranch Hand
Posts: 41
Java ME Objective C Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bhanu,

You right, I've read the question too quickly.
I miss the EB part of your question.

This thread might clarify your doubts even further.

http://www.coderanch.com/t/317305/EJB-JEE/java/why-entity-bean-cannot-manage

Sylvain
SCJP - SCWCD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic