--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.sql.execute.ExecutionContext\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to you under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.sql.execute;\r
+\r
+import org.apache.derby.iapi.services.context.Context;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+import org.apache.derby.iapi.sql.ResultSet;\r
+\r
+/**\r
+ * ExecutionContext stores the factories that are to be used by\r
+ * the current connection. It also provides execution services\r
+ * for statement atomicity.\r
+ *\r
+ */\r
+public interface ExecutionContext extends Context {\r
+\r
+ /**\r
+ * this is the ID we expect execution contexts\r
+ * to be stored into a context manager under.\r
+ */\r
+ String CONTEXT_ID = "ExecutionContext";\r
+ \r
+ \r
+ /* Constants for scan isolation levels. */\r
+ public static final int UNSPECIFIED_ISOLATION_LEVEL = 0;\r
+ public static final int READ_UNCOMMITTED_ISOLATION_LEVEL = 1;\r
+ public static final int READ_COMMITTED_ISOLATION_LEVEL = 2;\r
+ public static final int REPEATABLE_READ_ISOLATION_LEVEL = 3;\r
+ public static final int SERIALIZABLE_ISOLATION_LEVEL = 4;\r
+\r
+ public static final int[] CS_TO_JDBC_ISOLATION_LEVEL_MAP = {\r
+ java.sql.Connection.TRANSACTION_NONE, // UNSPECIFIED_ISOLATION_LEVEL\r
+ java.sql.Connection.TRANSACTION_READ_UNCOMMITTED, // READ_UNCOMMITTED_ISOLATION_LEVEL\r
+ java.sql.Connection.TRANSACTION_READ_COMMITTED, // READ_COMMITTED_ISOLATION_LEVEL\r
+ java.sql.Connection.TRANSACTION_REPEATABLE_READ, // REPEATABLE_READ_ISOLATION_LEVEL \r
+ java.sql.Connection.TRANSACTION_SERIALIZABLE // SERIALIZABLE_ISOLATION_LEVEL\r
+ };\r
+\r
+ public static final String[][] CS_TO_SQL_ISOLATION_MAP = {\r
+ { " "}, // UNSPECIFIED_ISOLATION_LEVEL\r
+ { "UR", "DIRTY READ", "READ UNCOMMITTED"},\r
+ { "CS", "CURSOR STABILITY", "READ COMMITTED"},\r
+ { "RS"}, // read stability \r
+ { "RR", "REPEATABLE READ", "SERIALIZABLE"}\r
+ };\r
+\r
+ /**\r
+ * Get the ResultSetStatisticsFactory from this ExecutionContext.\r
+ *\r
+ * @return The result set statistics factory associated with this\r
+ * ExecutionContext\r
+ *\r
+ * @exception StandardException Thrown on error\r
+ */\r
+ ResultSetStatisticsFactory getResultSetStatisticsFactory()\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Get the ExecutionFactory from this ExecutionContext.\r
+ *\r
+ * @return The Execution factory associated with this\r
+ * ExecutionContext\r
+ */\r
+ ExecutionFactory getExecutionFactory();\r
+}\r