| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Package txnBuf contains a transaction buffer filter for the datastore | 5 // Package txnBuf contains a transaction buffer filter for the datastore |
| 6 // service. | 6 // service. |
| 7 // | 7 // |
| 8 // By default, datastore transactions take a snapshot of the entity group as | 8 // By default, datastore transactions take a snapshot of the entity group as |
| 9 // soon as you Get or Put into it. All subsequent Get (and query) operations | 9 // soon as you Get or Put into it. All subsequent Get (and query) operations |
| 10 // reflect the state of the ORIGINAL transaction snapshot, regardless of any | 10 // reflect the state of the ORIGINAL transaction snapshot, regardless of any |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // not affect the query results (e.g. the query has snapshot consistency | 66 // not affect the query results (e.g. the query has snapshot consistency |
| 67 // from the moment that it begins iteration). Note, however, that datastore | 67 // from the moment that it begins iteration). Note, however, that datastore |
| 68 // operations within the callback are still synchronized. This behavior is | 68 // operations within the callback are still synchronized. This behavior is |
| 69 // so that the user is not forced to buffer all of the query results before | 69 // so that the user is not forced to buffer all of the query results before |
| 70 // doing work with them, but can treat the query like a stream of events, | 70 // doing work with them, but can treat the query like a stream of events, |
| 71 // if they so choose. | 71 // if they so choose. |
| 72 // | 72 // |
| 73 // - The changing of namespace inside of a transaction is undefined... This is | 73 // - The changing of namespace inside of a transaction is undefined... This is |
| 74 // just generally a terrible idea anyway, but I thought it was worth | 74 // just generally a terrible idea anyway, but I thought it was worth |
| 75 // mentioning. | 75 // mentioning. |
| 76 // |
| 77 // - Currently, the soft transactions are not directly accessible using the |
| 78 // CurrentTransaction interface; it returns the wrapped datastore's |
| 79 // transaction. While this is still correct, it could definitely be made |
| 80 // more useful by adding transaction buffer metadata to the returned |
| 81 // object. |
| 76 package txnBuf | 82 package txnBuf |
| OLD | NEW |