Hi,

i have migrated the most parts of my code to Jooq 3.2.2 it seems that the 
AutoCommit Feature now works. But did i still need the 
"SpringExceptionTranslationExecuteListener" that i have posted in my first 
post  with 3.2.2 ? I did not exactly understand why i need this Listener!?

For Transaction Handling i use google Guice, i have bind the @Transaction 
annotation to a seperate class that does via MethodInvocation the commit 
and rollback.
The Class looks like this:


class TransactionalMethodInterceptor implements MethodInterceptor {
>
>     @Inject
>     private DataSourceTransactionManager transactionManager;
>     
>
>     @Override
>     public Object invoke(final MethodInvocation invocation) throws 
> Throwable {
>         DefaultTransactionDefinition transactionDefinition = new 
> DefaultTransactionDefinition();
>         TransactionStatus transaction = transactionManager
>                 .getTransaction(transactionDefinition);
>         try {
>             Object result = invocation.proceed();
>             try {
>                 transactionManager.commit(transaction);
>             } catch (UnexpectedRollbackException e) {
>                 LoggerFactory.getLogger(getClass()).error(
>                         "commit failed  : " + e.getMessage());
>             }
>             return result;
>         } catch (Exception e) {
>             transactionManager.rollback(transaction);
>             throw e;
>         }
>     }
>
> }
>



And Second Question!
At the Moment i use this code to implement the SpringListener:


DataSourceConnectionProvider dataSourceProvider=new 
> DataSourceConnectionProvider(dataSource);
>         
>         // Create a configuration with an appropriate listener provider:
>         Configuration configuration = new 
> DefaultConfiguration().set(dataSourceProvider).set(SQLDialect.POSTGRES);
>      
>         configuration.set(new DefaultExecuteListenerProvider(new 
> SpringExceptionTranslationExecuteListener()));
>         
>         //-----------------------------------------
>         DSLContext create = DSL.using(configuration);
>


I did initialize different DataSourceConnectionProvider in several classes 
with the same dataSource Object(Via Singleton), can this be a problem ?



-- 
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/groups/opt_out.

Reply via email to