1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.services.context.ContextManager; 25 26 import org.apache.derby.iapi.services.compiler.MethodBuilder; 27 28 import org.apache.derby.iapi.error.StandardException; 29 30 import org.apache.derby.iapi.sql.execute.ConstantAction; 31 32 import org.apache.derby.iapi.sql.Activation; 33 import org.apache.derby.iapi.sql.ResultSet; 34 35 import org.apache.derby.impl.sql.compile.ActivationClassBuilder; 36 37 import org.apache.derby.iapi.services.sanity.SanityManager; 38 import org.apache.derby.iapi.reference.ClassName; 39 import org.apache.derby.iapi.services.classfile.VMOpcode; 40 41 47 48 public class SetTransactionIsolationNode extends TransactionStatementNode 49 { 50 private int isolationLevel; 51 52 57 public void init(Object isolationLevel) 58 { 59 this.isolationLevel = ((Integer ) isolationLevel).intValue(); 60 } 61 62 68 69 public String toString() 70 { 71 if (SanityManager.DEBUG) 72 { 73 return "isolationLevel: " + isolationLevel + "\n" + 74 super.toString(); 75 } 76 else 77 { 78 return ""; 79 } 80 } 81 82 public String statementToString() 83 { 84 return "SET TRANSACTION ISOLATION"; 85 } 86 87 94 public void generate(ActivationClassBuilder acb, 95 MethodBuilder mb) 96 throws StandardException 97 { 98 acb.pushGetResultSetFactoryExpression(mb); 99 100 acb.pushThisAsActivation(mb); 101 102 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "getSetTransactionResultSet", ClassName.ResultSet, 1); 103 } 104 105 106 111 public ConstantAction makeConstantAction() throws StandardException 112 { 113 return getGenericConstantActionFactory().getSetTransactionIsolationConstantAction(isolationLevel); 114 } 115 } 116 | Popular Tags |