Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Bean Things in ejbRemove, unsetEntityContext.

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic