1 9 package org.ozoneDB.xa; 10 11 import javax.transaction.*; 12 13 14 22 public final class OzoneUserTransaction implements UserTransaction { 23 24 27 private static TransactionManager txManager; 28 29 30 public void setTransactionManager( TransactionManager _txManager ) { 31 txManager = _txManager; 32 } 33 34 35 public OzoneUserTransaction() { 36 } 37 38 39 public void begin() throws NotSupportedException, SystemException { 40 if (txManager.getTransaction() != null) { 44 throw new NotSupportedException( "Nested transactions not supported in beans" ); 45 } 46 txManager.begin(); 47 } 48 49 50 public void commit() 51 throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException , 52 IllegalStateException , SystemException { 53 txManager.commit(); 54 } 55 56 57 public void rollback() throws IllegalStateException , SecurityException , SystemException { 58 txManager.rollback(); 59 } 60 61 62 public int getStatus() throws SystemException { 63 return txManager.getStatus(); 64 } 65 66 67 public void setRollbackOnly() throws SystemException { 68 txManager.setRollbackOnly(); 69 } 70 71 72 public void setTransactionTimeout( int seconds ) throws SystemException { 73 txManager.setTransactionTimeout( seconds ); 74 } 75 76 } 77 | Popular Tags |