Skip to content

INT-2568 added @Transactional to JdbcMessageStore - #571

Closed
olegz wants to merge 1 commit into
spring-projects:masterfrom
olegz:INT-2568
Closed

olegz wants to merge 1 commit into
spring-projects:masterfrom
olegz:INT-2568

Conversation

@olegz

@olegz olegz commented Aug 7, 2012

Copy link
Copy Markdown
Contributor

No description provided.

@ghillert

ghillert commented Aug 7, 2012

Copy link
Copy Markdown
Contributor

Not sure if this is relevant for INT-2568 but for the JPA Adapter I actually refrained from using @transactional because users may have the need to pass in their own TX Manager. Spring Data JPA is doing that with some tricks but ultimately decided not to go that route as it is a bit involved.

It ultimately looked much cleaner to apply our pre-existing transactional element logic:

if(transactionalElement != null) {
    BeanDefinition txAdviceDefinition = IntegrationNamespaceUtils.configureTransactionAttributes(transactionalElement);
    ManagedList<BeanDefinition> adviceChain = new ManagedList<BeanDefinition>();
    adviceChain.add(txAdviceDefinition);
    jpaOutboundChannelAdapterBuilder.addPropertyValue("adviceChain", adviceChain);
}

@olegz

olegz commented Aug 7, 2012

Copy link
Copy Markdown
Contributor Author

I guess I am missing something here. As you stated this only addresses automicity IF this message store is part of Spring TX but is called without existing TX.
If its not it has to be wrapped in some other transaction mechanism anyway.
Can you clarify?

@amolnayak311

Copy link
Copy Markdown
Contributor

The @transactional annotation would use the default transaction manager as we dont have the value attribute which can be used to specify the qualifier for transaction manager.
It is possible some transaction manager possibly a DS Txn manager on another DS is already configured as default transaction which is being used by the application in place (infact I am already working on one such application and that's the reason why i suggested not to go with these annotations in the JPA module). The message store might be in a different database and in such scenarios the JDBC message store could not be use as it has the @transactional annotation in the code. Letting user specify the transaction attribute and the manager in the xml declaration would give us more flexibility.

@olegz olegz closed this Aug 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants