[JAVA-3542] Add Transaction Example in the docs Created: 20/Aug/18 Updated: 30/Mar/22 |
|
| Status: | Backlog |
| Project: | Java Driver |
| Component/s: | Reactive Streams |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jody | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
It would be great to have a Transaction example in the documentation. On the first look, it does not seem trivial to me. My current approach (untested as of right now) is the following:
With a "helper" class to store information about each transaction (support insert and update at the same time)
My DAO will utilize the ClientSessionSubscriber like this:
Is this a valid approach? Some examples in the docs would be great! |
| Comments |
| Comment by Ross Lawley [ 17/Dec/18 ] |
|
Moving to Open. Using the session / transaction API with low level Publishers may be complex and nuanced. Using higher level libraries such as JavaRx2 or Reactor may provide a composable API that makes handling transactions much simpler. |
| Comment by Ross Lawley [ 20/Aug/18 ] |
|
Hi jody, JAVARS-77 was initially closed as a Observables aren't compsable in the reactive streams API, following the documentation example would be verbose and complex. There are higher level API's such as RxJava and Reactor that make the Observable pattern composable and allow for much simpler code when using Client Sessions. For that reason it was decided that following the documentation example wouldn't make much sense to users. Ross
|
| Comment by Jody [ 20/Aug/18 ] |
|
For some reason the Jira code formatting does not like the Google Java Style :/ I'm sorry for the badly formatted code |