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 <[email protected]> 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 [email protected]. > 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 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/CAB4ELO6G3GR7SAyOYFamHk2pBzVta8ggh%3Dce8KOLGfRjc5H8pQ%40mail.gmail.com.
