Hi Anto,

Thanks for your message. jOOQ 3.9 added support for a TransactionListener
SPI:

- https://github.com/jOOQ/jOOQ/issues/5378
- https://www.jooq.org/javadoc/latest/org/jooq/TransactionListener.html

It will allow you to get a hold of the cause for any rollback:
https://www.jooq.org/javadoc/latest/org/jooq/TransactionContext.html#cause--

I hope this helps,
Lukas

2017-04-27 8:05 GMT+02:00 Anto Aravinth <[email protected]>:

> Hi,
>
> I'm new to jooq and trying to do the following. I wanted to insert a data
> into the table. I'm running the following code in a transaction:
>
> dslContext.transaction(configuration -> {
>     DSLContext ctx = DSL.using(configuration);
>     ctx
>    .insertInto(USERDATA,USERDATA.USERNAME,USERDATA.PASSWORD)
>    .values(username,password)
>    .returning()
>    .fetchOne();
> });
>
> Now I want to understand that within a transaction how will I come to know
> if the code inside it was successful or not? (only with exceptions). How to
> do that? Also let me know how to get to know about exceptions, say if an
> exception occurs on duplicate value etc.
>
> Thanks for your response.
>
>
> --
> 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].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to