• 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

ejbCreate() and getUserTxn()

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
in ejb 2.0 spec >> page 90 >> ejbCreate() and ejbRemove() for SLSB BMT .. says bean instance can call getUserTxn()
can b called from ejbCreate() and ejbRemove() (but no methods allowed to invoke on UserTxn() ).
But HFEJB @ page 228 in chapter 4 says SLSB with BMT can't call getUserTxn() in ejbCreate() and ejbRemove().
pls clear me give clear picture on this...
Bin
 
Binoj Viswanathan
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

ejb spec says in the case of MDB also, u can call getUserTxn() in ejbCreate()and ejbRemove(). But in Both cases,MDB awa SLSB, with ejbCreate()and ejbRemove() r invoked without ani client security ctx or txn ctx.
so how cum v can invoke getUserTxn() in these methods?
bin
 
Binoj Viswanathan
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
???
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi......a possible but ugly approach.



//in bean class
public void ejbCreate()
{
...
...
...
ut=ctx.getUserTransaction();
}
public void myBizMet()
{
ut.begin();
...
...
...
..
ut.commit();


}

since this is very confusing and tempting to code ut.XXX in ejbCreate,
HFEJB says u cant.


hope that clears.
Amol.
reply
    Bookmark Topic Watch Topic
  • New Topic