hi ,
      i have a application which waits for credit card authorization and
which works like this

case1)
      credit card gets authorized
   if(authorized)
{
   select orderid.nextval;
}
       usersesion bean(stateful session bean)->insert tranactions into
transaction table with the corrsponding orderid.nextval;
     else{
    usersesion bean->insert tranactions into transaction table with the
null value for orderid;
      }
}
if (authorized)
{
call create on the container managed order bean with the not null order id
got from the sequence orderid.nextval;
}
else{not authorized)
{
order bean doesnot get created
}
as a result of which always
the  log for the transaction exists in the transaction table whether the
credit card gets authorized or not.

my question is:
1)what are the implications of keeping the sequence in the usersession bean.
so that if multiple users exists this sequence should not get corrupted in
between users.

2)worst case:
credit card gets authorized
1)so data went into transaction table with the correct order id but when it
is hitting the orders table by calling ejbcreate on order bean
  the transaction failed for unknown reasons.(still i have not stimulated
this case);
   so how to rollback the previous transaction that is the data that went
into the transaction table with the correct order id.
my probelm is my usersession bean is a stateful session bean with
tx_required and transaction_serializable.
i tried cahnging it to tx_beanmanaged and tx_serializanble
with explicit coding of jts apis insdie my code with
usertransaction.begin
if one transaction gets rolls back other transaction gets rolled back
usertransaction.end.
but  there are other methods in my usersession bean which is dependiing on
the container manged transaction attribute of
tx_required.
   so is it possible for me to have just this method alone managed by bean
managed transaction and rest all container managed transaction.
is this kind of demacration of setting the transaction attribute between
different method is possible.
3) what is proper way of doing this

thanx
ashwin

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to