This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

ejb-ref and ejb-local-ref can be used for message driven beans?  RSS feed

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think <ejb-ref> and <ejb-local-ref> are only used for session and entitiy beans, can we use them for message driven beans too?
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by yamini nadella:
I think <ejb-ref> and <ejb-local-ref> are only used for session and entitiy beans, can we use them for message driven beans too?



You can use them for MDB too. i.e. MDB intern can have reference with other beans.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a question about ejb-ref and ejb-local-ref... An enterprise bean can refer to the homes of other enterprise beans using "logical" names called EJB references. References to other beans can be local or remote. But, message driven beans have no unique identity to clients � they don�t have clients (NO home interface, NO component interface, and no local vs. remote).

So, my question is : Is it possible to define a <ejb-ref> or a <ejb-local-ref> elment for message-driven beans??? I mean is it possible to define this in the DD WITHOUT a <home> and <remote> element for <ejb-ref> or a <local-home> and <local> for <ejb-local-ref>???

I also thought that the <ejb-ref-type> element should NOT be a message-driven bean (and that the <res-ref-type> could only be either �Session� or �Entity�).

Please, help me out. I'm confused... Confused

(I also posted this question on jdiscuss.)
 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There seems to be a confusion here. Let me clarify this with this example of DD:

<message-driven>
............................
<ejb-name>MyMDBBean</ejb-name>
............................
<ejb-ref>
<ejb-ref-name>ejb/MySessionBean</ejb-ref-name>
<home>com.xyz.MySessionBeanRemoteHome</home>
<remote>com.xyz.MySessionBeanRemote</remote>
..........................................
</ejb-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/MyEntityBean</ejb-ref-name>
<local-home>com.xyz.MyEntityBeanLocalHome</local-home>
<local>com.xyz.MyEntityBeanLocal</local>
..........................................
</ejb-local-ref>
</message-driven>

Here MyMDBBean has remote reference(ejb-ref) to MySessionBean and local reference (ejb-local-ref) to MyEntityBean.

Hope this clears the confusion.

Thanks

-- Ravi
[ March 28, 2005: Message edited by: Ravindra Janapareddy ]
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karin,

If I understand your question correctly, according to my understanding-
It is possible to have (MDBs) refering Entity or Session beans. (as Ravindra explained.)
But no type of EJB can refer to MDB in ejb-ref.


<ejb-ref>
<description>ejb Reference description</description>
<ejb-ref-name>ejb/otherRemoteEntityName</ejb-ref-name>
<ejb-ref-type>Entity OR Session</ejb-ref-type>
<home>otherEntityBeanRemoteHome</home>
<remote>otherEntityBeanRemote</remote>
<ejb-link>SomeEntityOrSessionBeanName</ejb-link>
</ejb-ref>

Note --
<ejb-ref-type>Entity OR Session</ejb-ref-type>


Thanks,
Gemini
[ March 28, 2005: Message edited by: Gemini Moses ]
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was ever confused by <ejb-ref> and <ejb-local-ref> before. Actually, <ejb-ref> and <ejb-local-ref> mean that you want to use other bean <ejb-ref> inside a bean and you have to specify it in DD. For example, in a Message Driven bean, you want to use a Session Bean (MySessionBeanRemoteHome), then you must define this session bean as <ejb-ref> or <eib-local-ref>, just like above DD written by Ravindra Janapareddy.

Hope this help.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!