On Wed, Oct 2, 2019 at 3:22 PM Marshall Pierce <[email protected]> wrote:
> There's little downside to having this exposed as an extension method
> (extension methods can only access public members but not an issue here),
> and I think that's really the only reasonable way to do it. Technically I
> could provide a TransactionalCallable with a runBlocking{} inside it, and
> that would compile, but also lose much of the benefits of using coroutines
> (won't carry over coroutine context, ties up a thread). Instead, I threw
> together a quick proof of concept of one way it could work:
> https://github.com/jOOQ/jOOQ/compare/master...marshallpierce:kotlin-suspend-txn-result?expand=1
>
> This way does work and was "easy", but now there's essentially a
> duplicated copy of `transactionResult0`, which is pretty sad, and it's in
> `org.jooq.impl` to get access to DefaultTransactionContext and friends,
> creating a split package which will make JPMS upset.
>
> If there was another way to implement the listener stuff before and
> exception stuff after that didn't involve package-private classes (and
> hopefully also avoiding copy-and-paste code...), then the extension
> function could be in a separate package, and indeed a separate project
> entirely.
>
Sure, I understand the drawback of copy pasting, but that could be a viable
workaround for the time being. Thanks for documenting it.
> Or, if there isn't an option to use public types, could *gasp* actually
> use JPMS to expose the org.jooq.impl package to
> org.jooq.kotlin_stuff_goes_here. Mark Reinhold would be so happy.
>
I'm not touching JPMS anytime soon during the next year. Making jOOQ a
module provides almost zero value to the community right now (as JPMS
adoption is still incredibly low), while causing tons of headaches for us,
with IDEs and transitive dependencies still not being 100% ready for it.
Anyway, I wonder if we could simply include that Kotlin class in the jOOQ
library directly, instead of putting it in a new module... If our mostly
Java based integration tests don't fail because of some class loading
issue, I don't see a problem adding some Kotlin classes to org.jooq.impl.
I've created an issue for this:
https://github.com/jOOQ/jOOQ/issues/9335
Thanks,
Lukas
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/CAB4ELO4N9i9KKPFUrz%3Dj5Xd7h7rgugnkBq%2BQUVmfDSfGOscrvA%40mail.gmail.com.