• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Three questions

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Q1. In HFEJB mock test in Qusetion#42 its mentioned that ejbCreate can call another bean for a Stateful CMT bean. For this ejbCreate should be in a meaning ful transaction. But tx attribute is not specified for create methods for session beans. then how come?

Q2. In Qusetion#55 says that when creating a CMP entity bean you can call a business method. Now while creating entity bean means in ejbCreate or ejbPostCreate method. How can you call a business method from these method?

Q3. Option c of Qusetion#49 is said to be entity bean with BMT and the option is markes correct. Please confirm this is a mistake otherwise I loose all my confidence.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ans 1. You are right about transaction context not being specified for create of session beans.However you are allowed to invoke other beans in ejbCreate of stateful CMT session bean as per spec. As I see it, from ejbCreate you would probably call either a BMT or a CMT bean.With BMT it doesn�t matter whether the call is in a transaction.With CMT whether the invocation is successful or you get an exception depends on the transaction attribute that you specify for the invoked method

Ans 2.For a CMP entity bean, ejbCreate/ejbPostCreate runs within a transaction. So as such it wont have any issues invoking business methods.

Ans 3.You are right about this.You can refer to my earlier post regarding the same question
 
TejasAnand Gokhale
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regarding Answer1:But we never specify tx attribute for ejbCreate or create method of stateful beans.

Reg. ans2: How can you call a business in ejbcreate/postcreate? This would mean bean being client to itself.
 
paresh vernekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regarding answer 1:Since we dont specify transaction attributes, hence I said it would be a problem when you invoke a CMT which has a method with transaction attribute 'Mandatory'.
Regarding answer 2: A bean can invokes its own methods, implying it can be its own client.If I am not wrong the specifications doesn't mention that a bean cannot calls its own business methods.So even such an invocation would be valid

Please correct me if I am wrong

Regards,
Paresh Vernekar
 
The human mind is a dangerous plaything. This tiny ad is pretty safe:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic