1 8 9 package com.sleepycat.je; 10 11 15 public class TransactionConfig implements Cloneable { 16 17 21 public static final TransactionConfig DEFAULT = new TransactionConfig(); 22 23 private boolean sync = false; 24 private boolean noSync = false; 25 private boolean writeNoSync = false; 26 private boolean noWait = false; 27 private boolean readUncommitted = false; 28 private boolean readCommitted = false; 29 private boolean serializableIsolation = false; 30 31 35 public TransactionConfig() { 36 } 37 38 42 public void setSync(boolean sync) { 43 this.sync = sync; 44 } 45 46 50 public boolean getSync() { 51 return sync; 52 } 53 54 58 public void setNoSync(boolean noSync) { 59 this.noSync = noSync; 60 } 61 62 66 public boolean getNoSync() { 67 return noSync; 68 } 69 70 74 public void setWriteNoSync(boolean writeNoSync) { 75 this.writeNoSync = writeNoSync; 76 } 77 78 82 public boolean getWriteNoSync() { 83 return writeNoSync; 84 } 85 86 90 public void setNoWait(boolean noWait) { 91 this.noWait = noWait; 92 } 93 94 98 public boolean getNoWait() { 99 return noWait; 100 } 101 102 106 public void setReadUncommitted(boolean readUncommitted) { 107 this.readUncommitted = readUncommitted; 108 } 109 110 114 public boolean getReadUncommitted() { 115 return readUncommitted; 116 } 117 118 123 public void setDirtyRead(boolean dirtyRead) { 124 setReadUncommitted(dirtyRead); 125 } 126 127 132 public boolean getDirtyRead() { 133 return getReadUncommitted(); 134 } 135 136 140 public void setReadCommitted(boolean readCommitted) { 141 this.readCommitted = readCommitted; 142 } 143 144 148 public boolean getReadCommitted() { 149 return readCommitted; 150 } 151 152 156 public void setSerializableIsolation(boolean serializableIsolation) { 157 this.serializableIsolation = serializableIsolation; 158 } 159 160 164 public boolean getSerializableIsolation() { 165 return serializableIsolation; 166 } 167 168 172 TransactionConfig cloneConfig() { 173 try { 174 return (TransactionConfig) super.clone(); 175 } catch (CloneNotSupportedException willNeverOccur) { 176 return null; 177 } 178 } 179 } 180 | Popular Tags |