Ok, let's try and fix the code together then.

@Override
@Transactional(propagation = Propagation.NESTED)
public Boolean save(Long version, ReconciliationResult reconciliationResult) {

....
}

So here's the main method that interacts with the DSL context object, from
the Javadocs it looks like @Transactional doesn't support propagation to
the transaction context to any spawned threads.

I am guessing the best bet is to call the transaction API provided by Jooq,
will the threads spawned from the *dslContext.transaction(configuration ->
{ ..// threads spawned here }); *have access to the same transaction.

*Apoorv Naik*


On Thu, Feb 11, 2021 at 10:40 AM Lukas Eder <lukas.e...@gmail.com> wrote:

> No, we don't have such a wiki yet
>
> On Thu, Feb 11, 2021 at 6:35 PM Apoorv Naik <naik.apo...@gmail.com> wrote:
>
>> Yes, you're right, I'm using the standard spring data source backed by
>> HikariCP and relying on JooqAutoConfiguration to do the rest. Do you have a
>> detailed wiki or manual for creating a custom data source / connection
>> provider that would support what I need?
>>
>> I want to give it a shot before having you take a look at it.
>>
>> *Apoorv Naik*
>>
>>
>> On Thu, Feb 11, 2021 at 3:22 AM Lukas Eder <lukas.e...@gmail.com> wrote:
>>
>>> You're probably running this code with a standard, thread-bound
>>> DataSource such as e.g. Spring is offering. This means that each of these
>>> async threads will spawn a new transaction, because that's how this
>>> DataSource works.
>>>
>>> You will need to implement a DataSource, or a jOOQ ConnectionProvider
>>> that can handle this, or if you're using jOOQ's transaction API (async or
>>> not), the Configuration available to the transactional scope will always
>>> use the same Connection instance, which holds the transaction.
>>>
>>> I'll be happy to review actual code if you're interested.
>>>
>>> Thanks,
>>> Lukas
>>>
>>> On Wed, Feb 10, 2021 at 11:20 PM Apoorv Naik <naik.apo...@gmail.com>
>>> wrote:
>>>
>>>> I was experimenting with performing writes using the runAsync
>>>> construct. What I have observed is that the statements in the runAsync have
>>>> no knowledge of the writes that happened in the main thread that spawned
>>>> these async tasks.
>>>>
>>>> My question is around how to run async tasks under the same transaction
>>>> context as the thread that is spawning the async tasks.
>>>>
>>>> Is this something that's doable? Is there a better approach for
>>>> performing async writes ?
>>>>
>>>> --
>>>> 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 jooq-user+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jooq-user/36d068a7-f26d-4241-82a3-d322c71d38e8n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/jooq-user/36d068a7-f26d-4241-82a3-d322c71d38e8n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "jOOQ User Group" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/jooq-user/ELuU4s9i1WI/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> jooq-user+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jooq-user/CAB4ELO6G3GR7SAyOYFamHk2pBzVta8ggh%3Dce8KOLGfRjc5H8pQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO6G3GR7SAyOYFamHk2pBzVta8ggh%3Dce8KOLGfRjc5H8pQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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 jooq-user+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jooq-user/CAOT1%3D3_YNMxCJbvNwXwGwAt0tapn34HAsP3_03L7NELA27-SEw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jooq-user/CAOT1%3D3_YNMxCJbvNwXwGwAt0tapn34HAsP3_03L7NELA27-SEw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "jOOQ User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jooq-user/ELuU4s9i1WI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jooq-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/CAB4ELO4yYvJJFTEF6PgH15n5Ew90G_V6fJEt2%3DzgE2dne0hjXw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO4yYvJJFTEF6PgH15n5Ew90G_V6fJEt2%3DzgE2dne0hjXw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAOT1%3D3_Heek4Kc_apUsGWRCgwOoT6JYO%2Bxegb0HySE_5Tk66iQ%40mail.gmail.com.

Reply via email to