KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > transaction > UserTransaction

javax.transaction
Interface UserTransaction

See Also:
Top Examples, Source Code

public void begin()
           throws NotSupportedException,
                  SystemException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[27]Example of using UserTransaction
By Anonymous on 2005/08/22 06:48:43  Rate
javax.transaction.UserTransaction userTransaction=m_ctx.getUserTransaction (  ) ; 
  try {  
      userTransaction.begin (  ) ; 
      ........................... 
      ......................... // Bussiness Logic 
      userTransaction.commit (  ) ; 
   } catch ( Exception e )  {  
      if ( userTransaction!=null )  userTransaction.rollback (  ) ; 
      throw e; 
   }  


public void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   IllegalStateException,
                   SystemException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getStatus()
              throws SystemException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void rollback()
              throws IllegalStateException,
                     SecurityException,
                     SystemException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setRollbackOnly()
                     throws IllegalStateException,
                            SystemException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setTransactionTimeout(int seconds)
                           throws SystemException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags