Commit 118a177
authored
feat: add isolation level option for disabling internal retries (#327)
Internal retries of aborted transactions is enabled by default for
database/sql connections for Spanner. However, when an application or
framework knows that it will retry the transaction using a retry-loop,
it is more efficient to disable internal retries.
Some frameworks, such as gorm, however make this hard to achieve, as
they only allow TxOptions to be used to configure the transaction, and
do not give access to the underlying driver or connection.
This change adds a custom isolation level that can be used to disable
internal retries of aborted transactions.1 parent b4803a6 commit 118a177
2 files changed
+96
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1219 | 1233 | | |
1220 | 1234 | | |
1221 | 1235 | | |
| |||
1231 | 1245 | | |
1232 | 1246 | | |
1233 | 1247 | | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
1234 | 1257 | | |
1235 | 1258 | | |
1236 | 1259 | | |
| |||
1259 | 1282 | | |
1260 | 1283 | | |
1261 | 1284 | | |
1262 | | - | |
| 1285 | + | |
1263 | 1286 | | |
1264 | 1287 | | |
1265 | 1288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2922 | 2922 | | |
2923 | 2923 | | |
2924 | 2924 | | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
2925 | 2997 | | |
2926 | 2998 | | |
2927 | 2999 | | |
| |||
0 commit comments