01: /*
02:
03: Derby - Class org.apache.derby.impl.store.raw.xact.SavePoint
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.impl.store.raw.xact;
23:
24: import org.apache.derby.iapi.store.raw.log.LogInstant;
25:
26: import org.apache.derby.iapi.services.sanity.SanityManager;
27:
28: class SavePoint {
29: /*
30: ** Fields
31: */
32:
33: private LogInstant savePoint;
34: private final String name;
35: //kindOfSavepoint can have 3 possible values.
36: //A NULL value means it is an internal savepoint (ie not a user defined savepoint)
37: //Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepoint
38: // A String value for kindOfSavepoint would mean it is SQL savepoint
39: // A JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint
40: private Object kindOfSavepoint;
41:
42: /*
43: ** Constructor
44: */
45:
46: SavePoint(String name, Object kindOfSavepoint) {
47: super ();
48: this .name = name;
49: this .kindOfSavepoint = kindOfSavepoint;
50: }
51:
52: void setSavePoint(LogInstant savePoint) {
53: if (SanityManager.DEBUG) {
54: SanityManager.ASSERT((savePoint == null)
55: || (this .savePoint == null));
56: }
57:
58: this .savePoint = savePoint;
59: }
60:
61: LogInstant getSavePoint() {
62: return savePoint;
63: }
64:
65: String getName() {
66: return name;
67: }
68:
69: boolean isThisUserDefinedsavepoint() {
70: return (kindOfSavepoint != null ? true : false);
71: }
72:
73: Object getKindOfSavepoint() {
74: return kindOfSavepoint;
75: }
76:
77: }
|