Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbCreate() and getUserTxn()

 
Binoj Viswanathan
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
???
 
amol deshpande
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic