jQuery in Action, 2nd edition*
The moose likes EJB and other Java EE Technologies and the fly likes How to call ENtity Bean from Message driven bean 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 "How to call ENtity Bean from Message driven bean" Watch "How to call ENtity Bean from Message driven bean" New topic
Author

How to call ENtity Bean from Message driven bean

karthik kummar
Greenhorn

Joined: Jun 23, 2010
Posts: 11
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

Joined: Mar 17, 2012
Posts: 892
    
    9
Do you know how to call it from a session bean?
Use the same approach.
karthik kummar
Greenhorn

Joined: Jun 23, 2010
Posts: 11
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

Joined: May 26, 2003
Posts: 31076
    
233

What version of EJB are you on? The rules are very different by version.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
karthik kummar
Greenhorn

Joined: Jun 23, 2010
Posts: 11
I am using EJB 3.0
Vaibhav Bhardwaj
Greenhorn

Joined: Feb 20, 2012
Posts: 5

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.


Vaibhav : Understanding Java
Mahendr Shinde
Ranch Hand

Joined: Sep 03, 2011
Posts: 38

In EJB 3.0, Entity's are NOT Beans, they are simple POJO classes. You can use them just like any other java classes.


There is still lot to learn!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call ENtity Bean from Message driven bean