Skip to content

Conversation

@nvamelichev
Copy link
Collaborator

Very very experimental atm. Problems:

  • Not especially nice to use compared to @Inject'ing your Db implementation (that is just BaseDb.current()) /Using BaseDb.current() directly.
  • Function<Db, R> and Consumer are lambda signature-compatible, this leads to unability to have the same tx() name for both methods, and we get ScopedTxManager.call() and ScopedTxManager.run(), which is sub-optimal
  • Even if we only have one Function<Db,R>-taking method in ScopedManager, we get generics hell with AssertJ's assertThat(): results of Function<Db,R>-taking method are considered by javac to be compatible with almost every interface argument that assertThat() takes!
  • ReadOnlyBuilder/ScanBuilder are not supported (yet)

…s WIP WIP WIP

Very very experimental atm. Problems:
- Not especially nice to use compared to @Inject'ing your Db implementation (that is just BaseDb.current())
  /Using BaseDb.current() directly.
- Function<Db, R> and Consumer<Db> are lambda signature-compatible, this leads to
  unability to have the same tx() name for both methods, and we get
  ScopedTxManager.call() and ScopedTxManager.run(), which is sub-optimal
- Even if we only have one Function<Db,R>-taking method in ScopedManager,
  we get generics hell with AssertJ's assertThat(): results of Function<Db,R>-taking
  method are considered by javac to be compatible with almost every interface
  argument that assertThat() takes!
- ReadOnlyBuilder/ScanBuilder are not supported (yet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants