Win a copy of Fixing your Scrum this week in the Agile 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Operations Allowed in the Methods of a MDB

 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Is invoking getEJBObject or getEJBLocalObject allowed in message-driven bean methods?

I looked at the EJB specifications and it doesn't mention this although it does mention that "Invoking getEJBHome or getEJBLocalHome is disallowed in message-driven bean methods".

Thanks

-- Ravi
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you talk to MDB through the JMS, you never get a reference to a bean or an EJBObject.

So MDB don't have homes, infact you don't even write a home or component interface, only the bean class
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

So what happens if getEJBObject or getEJBLocalObject is invoked in message-driven bean methods. Does it throw java.lang.IllegalStateException?

Thanks

-- Ravi
[ March 25, 2005: Message edited by: Ravindra Janapareddy ]
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right ravi,
Its java.lang.IllegalStateException....will kill bean, Tx rollback and log it.(i mean bean instance....i know u know..but..)
amol.
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

EntityContext provides getEJBObject, getEJBLocalObject and getPrimaryKey methods apart from the methods inhertited from EJBContext.

SessionContext provides getEJBObject and getEJBLocalObject methods apart from the methods inhertited from EJBContext.

Whereas MessageDrivenContext doesn't provide any methods apart from the methods inhertited from EJBContext.

That explains the answer.

Thanks

-- Ravi
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic