Hi Jeff,

Thank you very much for your message, and a Happy New Year to you too.

We have a pending feature request regarding this functionality in jOOQ:
https://github.com/jOOQ/jOOQ/issues/5905

It would indeed seem quite useful to have an out-of-the-box way of retrying
a statement under certain conditions. However, this is much more
complicated than it first seems. Our ConnectionProvider abstracts
completely over the connection life cycle and even the transaction life
cycle if users choose to do so. It would be difficult to offer a solution
that works for all ConnectionProvider implementations.

For simple cases, however, I do wonder if such retry functionality might be
sufficiently easy to implement as a JDBC proxy, where you supply jOOQ with
a proxied Connection that takes care of re-connecting itself, transparently
to jOOQ. There might be some connection pools capable of doing this?

Thanks,
Lukas

On Thu, Jan 2, 2020 at 7:34 PM Jeffrey Backes <[email protected]> wrote:

> Greetings and Happy New Year,
>
> I am having trouble writing code that implements connection failure retry
> using JOOQ.
>
> When the connection fails I receive a DataAccessException as expected. I
> then reestablish the connection to the database and attempt to call
> batch.execute() again.  As you can imagine this throws a
> DataAccessException with "Connection is closed" message.
>
> I need a way to update the batch's connection context but I don't see a
> public class that will let me get access. I don't want to keep the records
> in a cache and replay them, it could be tens of thousand of records.
>
> Can someone point me to a way of sending a message to the batch that I
> have established a new connection to the database?
>
> jeff
>
> --
> 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/9adf3fff-2c4c-4984-b6d9-e19702228760%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/9adf3fff-2c4c-4984-b6d9-e19702228760%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/CAB4ELO6tHE%2BcCQ%3DFXfQ_go%3DL8x%3DGzhoL8yWydDM_JbT9xeORbA%40mail.gmail.com.

Reply via email to