1 22 package org.jboss.test.jca.test; 23 24 import javax.transaction.Status ; 25 import javax.transaction.Transaction ; 26 27 33 public class AbstractRecyclingPoolingStressTest extends AbstractPoolingStressTest 34 { 35 36 public abstract class RecyclingPoolingRunnable extends ConcurrentRunnable 37 { 38 protected Transaction tx; 39 public RecyclingPoolingRunnable() 40 { 41 } 42 43 public void doStart() throws Throwable 44 { 45 } 46 47 public void doEnd() throws Throwable 48 { 49 } 50 51 public void doRun() throws Throwable 52 { 53 tm.begin(); 54 try 55 { 56 doRun1(); 57 } 58 catch (Throwable t) 59 { 60 tm.setRollbackOnly(); 61 throw t; 62 } 63 finally 64 { 65 if (tm.getStatus() == Status.STATUS_MARKED_ROLLBACK) 66 tm.rollback(); 67 else 68 tm.commit(); 69 } 70 } 71 72 public abstract void doRun1() throws Throwable ; 73 } 74 75 76 public AbstractRecyclingPoolingStressTest(String name) 77 { 78 super(name); 79 } 80 } 81 | Popular Tags |