|
17 | 17 |
|
18 | 18 | import java.time.Duration; |
19 | 19 | import java.time.temporal.ChronoUnit; |
20 | | -import java.util.Optional; |
21 | | -import java.util.UUID; |
22 | 20 | import java.util.function.Supplier; |
23 | 21 |
|
24 | | -import com.couchbase.transactions.AttemptContext; |
25 | | -import com.couchbase.transactions.AttemptContextReactiveAccessor; |
26 | | -import com.couchbase.transactions.TransactionContext; |
27 | | -import com.couchbase.transactions.config.MergedTransactionConfig; |
28 | | -import com.couchbase.transactions.config.PerTransactionConfig; |
29 | | -import com.couchbase.transactions.config.PerTransactionConfigBuilder; |
30 | 22 | import org.springframework.dao.support.PersistenceExceptionTranslator; |
31 | 23 | import org.springframework.data.couchbase.core.CouchbaseExceptionTranslator; |
32 | 24 | import org.springframework.data.couchbase.transaction.ClientSession; |
33 | 25 | import org.springframework.data.couchbase.transaction.ClientSessionImpl; |
34 | 26 | import org.springframework.data.couchbase.transaction.ClientSessionOptions; |
35 | | -import org.springframework.data.couchbase.transaction.CouchbaseStuffHandle; |
36 | 27 |
|
37 | 28 | import com.couchbase.client.core.env.Authenticator; |
38 | 29 | import com.couchbase.client.core.env.OwnedSupplier; |
|
43 | 34 | import com.couchbase.client.java.Collection; |
44 | 35 | import com.couchbase.client.java.Scope; |
45 | 36 | import com.couchbase.client.java.env.ClusterEnvironment; |
| 37 | +import com.couchbase.transactions.AttemptContext; |
46 | 38 | import com.couchbase.transactions.AttemptContextReactive; |
| 39 | +import com.couchbase.transactions.AttemptContextReactiveAccessor; |
47 | 40 | import com.couchbase.transactions.Transactions; |
48 | 41 | import com.couchbase.transactions.config.TransactionConfig; |
49 | 42 |
|
@@ -85,16 +78,10 @@ public SimpleCouchbaseClientFactory(final Cluster cluster, final String bucketNa |
85 | 78 |
|
86 | 79 | private SimpleCouchbaseClientFactory(final Supplier<Cluster> cluster, final String bucketName, |
87 | 80 | final String scopeName) { |
88 | | - this(cluster, bucketName, scopeName, null); |
89 | | - } |
90 | | - |
91 | | - private SimpleCouchbaseClientFactory(final Supplier<Cluster> cluster, final String bucketName, final String scopeName, |
92 | | - final CouchbaseStuffHandle transactionalOperator) { |
93 | 81 | this.cluster = cluster; |
94 | 82 | this.bucket = cluster.get().bucket(bucketName); |
95 | 83 | this.scope = scopeName == null ? bucket.defaultScope() : bucket.scope(scopeName); |
96 | 84 | this.exceptionTranslator = new CouchbaseExceptionTranslator(); |
97 | | - //this.transactionalOperator = transactionalOperator; |
98 | 85 | } |
99 | 86 |
|
100 | 87 | @Override |
@@ -142,23 +129,23 @@ public PersistenceExceptionTranslator getExceptionTranslator() { |
142 | 129 | @Override |
143 | 130 | public ClientSession getSession(ClientSessionOptions options, Transactions transactions, TransactionConfig config, |
144 | 131 | AttemptContextReactive atr) { |
145 | | - // can't we just use AttemptContextReactive everywhere? Instead of creating AttemptContext(atr), then |
| 132 | + // can't we just use AttemptContextReactive everywhere? Instead of creating AttemptContext(atr), then |
146 | 133 | // accessing at.getACR() ? |
147 | | - AttemptContext at = AttemptContextReactiveAccessor.from( atr != null ? atr : AttemptContextReactiveAccessor.newAttemptContextReactive(transactions.reactive())); |
| 134 | + AttemptContext at = AttemptContextReactiveAccessor |
| 135 | + .from(atr != null ? atr : AttemptContextReactiveAccessor.newAttemptContextReactive(transactions.reactive())); |
148 | 136 |
|
149 | 137 | return new ClientSessionImpl(this, transactions, config, at); |
150 | 138 | } |
151 | 139 |
|
| 140 | + // @Override |
| 141 | + // public CouchbaseClientFactory with(CouchbaseStuffHandle txOp) { |
| 142 | + // return new SimpleCouchbaseClientFactory(cluster, bucket.name(), scope.name(), txOp); |
| 143 | + // } |
152 | 144 |
|
153 | | - //@Override |
154 | | - //public CouchbaseClientFactory with(CouchbaseStuffHandle txOp) { |
155 | | - // return new SimpleCouchbaseClientFactory(cluster, bucket.name(), scope.name(), txOp); |
156 | | - //} |
157 | | - |
158 | | - //@Override |
159 | | - //public CouchbaseStuffHandle getTransactionalOperator() { |
160 | | - // return (CouchbaseStuffHandle) transactionalOperator; |
161 | | - //} |
| 145 | + // @Override |
| 146 | + // public CouchbaseStuffHandle getTransactionalOperator() { |
| 147 | + // return (CouchbaseStuffHandle) transactionalOperator; |
| 148 | + // } |
162 | 149 |
|
163 | 150 | @Override |
164 | 151 | public void close() { |
|
0 commit comments