Patches item #541946, was opened at 2002-04-10 11:38
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=541946&group_id=22866

Category: None
Group: v2.4 (stable)
Status: Open
Resolution: None
Priority: 5
Submitted By: Emmanuel Valentin (emmanuelv)
Assigned to: Nobody/Anonymous (nobody)
Summary: possible solution for bug 481358&486416

Initial Comment:
JDK 1.3.1. JBoss 2.4.4 on Win NT

These bugs concern the user transaction commit phase 
when invoked from the client side. It seems that 
during the invocation of UserTransactionSessionImpl. 
commit(), the transaction / calling thread relation is 
not resumed. This prevents any db changes made by a tx 
listener to be committed in the db.  

If the UserTransactionSessionImpl.commit( Object tpc) 
method resumes this relation, changes are committed in 
the db. This is also valable for the rollback method. 

I did not notice any side effect due to this patch, 
homewer I don't have a clear idea of the transaction 
management in JBoss. could you review this solution ? 


Emmanuel


Proposed change : 
file :  UserTransactionSessionImpl.java

   public void commit(Object tpc)
      throws RemoteException,
             RollbackException,
             HeuristicMixedException,
             HeuristicRollbackException,
             SecurityException,
             IllegalStateException,
             SystemException
{
      Transaction tx = (Transaction)activeTx.get(tpc);

      if (tx == null)
         throw new IllegalStateException("No 
transaction.");

//*** added patch
      TransactionManager tm = getTransactionManager();

      Transaction currentTx = tm.suspend();
      tm.resume(tx);
//*** end of change

      boolean finished = true;

      try {
            System.out.println("commit user 
transaction");
            System.out.println("Current transaction 
is  "+ tx + " / " + tx.getClass());
            System.out.println("Current thread 
transaction is "+ tm.getTransaction());

         tx.commit();
            System.out.println("end of commit user 
transaction");

      } catch (java.lang.SecurityException ex) {
         finished = false;
         throw ex;
      } catch (java.lang.IllegalStateException ex) {
         finished = false;
         throw ex;
      } finally {
         activeTx.remove(tpc);

//*** added patch
         tm.suspend();

         if ( currentTx != null)
            tm.resume(currentTx);
//*** end of change

      }
   }


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=541946&group_id=22866

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to