File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/main/java/io/cdap/cdap/storage/spanner Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 3939 <dependency >
4040 <groupId >com.google.cloud</groupId >
4141 <artifactId >libraries-bom</artifactId >
42- <version >26.55 .0</version >
42+ <version >26.78 .0</version >
4343 <type >pom</type >
4444 <scope >import</scope >
4545 </dependency >
Original file line number Diff line number Diff line change 2121import com .google .cloud .spanner .InstanceId ;
2222import com .google .cloud .spanner .Spanner ;
2323import com .google .cloud .spanner .SpannerOptions ;
24+ import com .google .cloud .spanner .SpannerOptions .Builder .DefaultReadWriteTransactionOptions ;
25+ import com .google .spanner .v1 .TransactionOptions .IsolationLevel ;
2426import io .cdap .cdap .spi .data .StorageProvider ;
2527import io .cdap .cdap .spi .data .StorageProviderContext ;
2628import io .cdap .cdap .spi .data .StructuredTableAdmin ;
@@ -77,7 +79,13 @@ public void initialize(StorageProviderContext context) throws Exception {
7779 throw new IllegalArgumentException ("Missing configuration " + DATABASE );
7880 }
7981
80- SpannerOptions .Builder builder = SpannerOptions .newBuilder ().setProjectId (project );
82+ DefaultReadWriteTransactionOptions transactionOptions =
83+ DefaultReadWriteTransactionOptions .newBuilder ()
84+ .setIsolationLevel (IsolationLevel .SERIALIZABLE )
85+ .build ();
86+
87+ SpannerOptions .Builder builder = SpannerOptions .newBuilder ()
88+ .setDefaultTransactionOptions (transactionOptions ).setProjectId (project );
8189
8290 String credentialsPath = conf .get (CREDENTIALS_PATH );
8391 if (credentialsPath != null ) {
You can’t perform that action at this time.
0 commit comments