Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to call ENtity Bean from Message driven bean  RSS feed

 
karthik kummar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to call Entity Bean from MDB. whether is it possible.
if it is possible ,could you explain how to configure.
 
E Armitage
Rancher
Posts: 989
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to call it from a session bean?
Use the same approach.
 
karthik kummar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont know about this(calling session bean from MDB ). I am new to EJB beans, could you please explain with some example. It could help me to understand.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of EJB are you on? The rules are very different by version.
 
karthik kummar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using EJB 3.0
 
Vaibhav Bhardwaj
Greenhorn
Posts: 5
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example , Hello is Entity Bean whom you want to invoke.
So from client class i.e. your MDB , you can use below code & MDB is nothing but a java class with annotation "@MessageDriven".


Context ctx = new InitialContext();
Hello hello = (Hello)ctx.lookUp("JNDIName");

now use "hello" to invoke business methods.
 
Mahendr Shinde
Ranch Hand
Posts: 38
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EJB 3.0, Entity's are NOT Beans, they are simple POJO classes. You can use them just like any other java classes.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!