• 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
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Bean Things in ejbRemove, unsetEntityContext.

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

If follwoing are the bean things (extracted from Heads First for EJB):

1. get reference to EJB Home
2. get reference to EJB Object
3. get security information from client
4. get primary key
5. force a transaction to rollback(CMT)
6. find if a transaction is already set to rollback(CMT)
7. get transaction reference and call methods on it(BMT)

Which are allowed to be done in :
1. stateless session bean's ejbRemove?
2. ejbRemove and unsetEntityContext of entity bean (CMT).
3. onMessage in message driven bean (ofcourse 1, 2, 3, 4 are already
ruled out).

Thanks in advance.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rehana Shaik,

Q1. For ejbRemove method in stateless session bean:
These are allowed
1. get reference to EJB Home
2. get reference to EJB Object
7. get transaction reference and call methods on it(BMT)
These not are allowed
3. get security information from client ( stateless session beans doesnot have any client specific information )
4. get primary key ( this cannot be called for session beans)
5. force a transaction to rollback(CMT) ( scince ejbRemove is running in a unspecified transaction , this is not allowed)
6. find if a transaction is already set to rollback(CMT) ( scince ejbRemove is running in a unspecified transaction , this is not allowed)


Q2.
For ejbRemove method in entity bean

All are allowed except
7. get transaction reference and call methods on it(BMT)-- because entity bean is always Container Managed.

For unsetEntityContext method in entity bean
This method is called when the entity object(not representing any entity in the persistent store) is in the pool.
Only 1. get reference to EJB Home is allowed here.

Q3.onMessage in message driven bean (ofcourse 1, 2, 3, 4 are already
ruled out).

This one you have already answered. 5 & 6 for CMT and 7 for BMT are allowed.



Thanks,
Chittaranjan
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic