35
35
public final class ClientSessionOptions {
36
36
37
37
private final Boolean causallyConsistent ;
38
- private final boolean autoStartTransaction ;
39
38
private final TransactionOptions defaultTransactionOptions ;
40
39
41
40
/**
@@ -50,17 +49,6 @@ public Boolean isCausallyConsistent() {
50
49
return causallyConsistent ;
51
50
}
52
51
53
- /**
54
- * Gets whether a transaction should be automatically started along with the session.
55
- *
56
- * @return whether a transaction should be automatically started along with the session. The default is false.
57
- * @since 3.8
58
- * @mongodb.server.release 4.0
59
- */
60
- public boolean getAutoStartTransaction () {
61
- return autoStartTransaction ;
62
- }
63
-
64
52
/**
65
53
* Gets the default transaction options for the session.
66
54
*
@@ -83,9 +71,6 @@ public boolean equals(final Object o) {
83
71
84
72
ClientSessionOptions that = (ClientSessionOptions ) o ;
85
73
86
- if (autoStartTransaction != that .autoStartTransaction ) {
87
- return false ;
88
- }
89
74
if (causallyConsistent != null ? !causallyConsistent .equals (that .causallyConsistent ) : that .causallyConsistent != null ) {
90
75
return false ;
91
76
}
@@ -100,7 +85,6 @@ public boolean equals(final Object o) {
100
85
@ Override
101
86
public int hashCode () {
102
87
int result = causallyConsistent != null ? causallyConsistent .hashCode () : 0 ;
103
- result = 31 * result + (autoStartTransaction ? 1 : 0 );
104
88
result = 31 * result + (defaultTransactionOptions != null ? defaultTransactionOptions .hashCode () : 0 );
105
89
return result ;
106
90
}
@@ -109,7 +93,6 @@ public int hashCode() {
109
93
public String toString () {
110
94
return "ClientSessionOptions{"
111
95
+ "causallyConsistent=" + causallyConsistent
112
- + ", autoStartTransaction=" + autoStartTransaction
113
96
+ ", defaultTransactionOptions=" + defaultTransactionOptions
114
97
+ '}' ;
115
98
}
@@ -134,7 +117,6 @@ public static Builder builder(final ClientSessionOptions options) {
134
117
notNull ("options" , options );
135
118
Builder builder = new Builder ();
136
119
builder .causallyConsistent = options .isCausallyConsistent ();
137
- builder .autoStartTransaction = options .getAutoStartTransaction ();
138
120
builder .defaultTransactionOptions = options .getDefaultTransactionOptions ();
139
121
return builder ;
140
122
}
@@ -145,7 +127,6 @@ public static Builder builder(final ClientSessionOptions options) {
145
127
@ NotThreadSafe
146
128
public static final class Builder {
147
129
private Boolean causallyConsistent ;
148
- private boolean autoStartTransaction ;
149
130
private TransactionOptions defaultTransactionOptions = TransactionOptions .builder ().build ();
150
131
151
132
/**
@@ -160,20 +141,6 @@ public Builder causallyConsistent(final boolean causallyConsistent) {
160
141
return this ;
161
142
}
162
143
163
- /**
164
- * Sets whether operations using the session should causally consistent with each other.
165
- *
166
- * @param autoStartTransaction whether a transaction should be started automatically when the session is started.
167
- *
168
- * @return this
169
- * @since 3.8
170
- * @mongodb.server.release 4.0
171
- */
172
- public Builder autoStartTransaction (final boolean autoStartTransaction ) {
173
- this .autoStartTransaction = autoStartTransaction ;
174
- return this ;
175
- }
176
-
177
144
/**
178
145
* Sets whether operations using the session should causally consistent with each other.
179
146
*
@@ -202,7 +169,6 @@ private Builder() {
202
169
203
170
private ClientSessionOptions (final Builder builder ) {
204
171
this .causallyConsistent = builder .causallyConsistent ;
205
- this .autoStartTransaction = builder .autoStartTransaction ;
206
172
this .defaultTransactionOptions = builder .defaultTransactionOptions ;
207
173
}
208
174
}
0 commit comments