@@ -107,20 +107,23 @@ func (s *Session) EndSession(ctx context.Context) {
107
107
// parameter already has a Session attached to it, it will be replaced by this
108
108
// session. The fn callback may be run multiple times during WithTransaction due
109
109
// to retry attempts, so it must be idempotent.
110
- // If a command inside the callback fn fails, it may cause the transaction on the
111
- // server to be aborted. This situation is normally handled transparently by the
112
- // driver. However, if the application does not return that error from the fn,
113
- // the driver will not be able to determine whether the transaction was aborted or
114
- // not. The driver will then retry the block indefinitely.
115
- // To avoid this situation, the application MUST NOT silently handle errors within
116
- // the callback fn. If the application needs to handle errors within the block,
117
- // it MUST return them after doing so.
118
- // Non-retryable operation errors or any operation errors that occur after the timeout
119
- // expires will be returned without retrying. If the callback fails, the driver will call
120
- // AbortTransaction. Because this method must succeed to ensure that server-side
121
- // resources are properly cleaned up, context deadlines and cancellations will
122
- // not be respected during this call. For a usage example, see the
123
- // Client.StartSession method documentation.
110
+ //
111
+ // If a command inside the callback fn fails, it may cause the transaction on
112
+ // the server to be aborted. This situation is normally handled transparently by
113
+ // the driver. However, if the application does not return that error from the
114
+ // fn, the driver will not be able to determine whether the transaction was
115
+ // aborted or not. The driver will then retry the block indefinitely.
116
+ //
117
+ // To avoid this situation, the application MUST NOT silently handle errors
118
+ // within the callback fn. If the application needs to handle errors within the
119
+ // block, it MUST return them after doing so.
120
+ //
121
+ // Non-retryable operation errors or any operation errors that occur after the
122
+ // timeout expires will be returned without retrying. If the callback fails, the
123
+ // driver will call AbortTransaction. Because this method must succeed to ensure
124
+ // that server-side resources are properly cleaned up, context deadlines and
125
+ // cancellations will not be respected during this call. For a usage example,
126
+ // see the Client.StartSession method documentation.
124
127
func (s * Session ) WithTransaction (
125
128
ctx context.Context ,
126
129
fn func (ctx context.Context ) (interface {}, error ),
0 commit comments