Hi Gerald,
Thanks for your quick response.
I have marked the transaction with propagation = Propagation.REQUIRED,
rollbackFor={Exception.class} attributes.
But this doesn't work.
Can you please tell me how I can check TransactionInteceptor is present? I
tried to place a break point in the method; but don't know how to detect
this. I have enabled logging at the debug level; but can't find anything
there.
Your help is greatly appreciated.
Thanks and Regards,
Sachin
On Thursday, 3 April 2014 16:32:22 UTC+5:30, Gérald Quintana wrote:
>
> Hi Sachin,
>
> First check the TransactionInterceptor aspect is properly applied on your
> service class: you can place breakpoint in the method and check that
> TransactionInteceptor is present, or you can place a breakpoint un
> TransactionInterceptor.
>
> Then, what kind of Exception is thrown? By default, Spring only rollbacks
> RuntimeException, jOOQ exceptions fall into this category. Did you override
> exception handling @Transactional(rollbackFor={MyCustomException.class})?
>
> Gerald
>
> Le jeudi 3 avril 2014 12:19:01 UTC+2, Sachin Kulkarni a écrit :
>>
>> Hi,
>>
>> I'm working on a spring (4.0.2)+ JOOQ (3.3.0) project, where I'm facing
>> issue with transactions.
>> I have set up the jooq datasource connection provider to be
>> transaction-aware in my servlet context as below:
>>
>> <bean id="transactionAwareDataSource"
>>
>> class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
>> <constructor-arg ref="dataSource" />
>> </bean>
>>
>> <bean class="org.jooq.impl.DataSourceConnectionProvider"
>> name="connectionProvider">
>> <constructor-arg ref="transactionAwareDataSource" />
>> </bean>
>>
>> I have methods in my service class which are decorated with
>> @Transactional. However, when an exception occurs, I find that the
>> transaction doesn't get rolled back (i.e. the database inserts I did in the
>> service method get stored in db).
>>
>> However, if I explicitly start a transaction myself in the method like so:
>> TransactionStatus tx = txMgr.getTransaction(new
>> DefaultTransactionDefinition());
>> and roll it back myself in exception handler like so:
>> txMgr.rollback(tx);
>>
>> That seems to work as I expect.
>>
>> What am I possibly missing to make @Transactional declaration work as we
>> expect them to work with JOOQ?
>>
>> Thanks and Regards,
>> Sachin
>>
>>
>>
--
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.