Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

ejbCreate() and getUserTxn()

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
???
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • 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