deneb wrote:
> thnx buddy
> i got that fine and working..
> 
> i really needed that fast but sorry for the late reply.
> also i would also ask one question:
> 
> if i have a method like in a bank
> x.withdraw(amonut)
> y.deposit(amount)
> 
> i want to maintain the user transaction so that i can commit or roll
> back
> could u guide me as to how could i do that

The best solution for this is to wrap the above calls in a session bean
that is set as transactional.

I.e. in Teller EJB:
public void transfer(Account acct1, Account acct2, balance amount)
{
  acct1.withdraw(amount);
  acct2.deposit(amount);
}

There is an example of this in the "jbosstest" CVS module. Look in the
bank example which does just this :-)

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to