Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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

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.
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic