I am a newbie to spring hibernate.
And I find 2 ways to handle transactions in Spring declaratively - ProxyFactoryBean using TransactionInterceptor or the @Transactional annotation.
How do we decide which one to prefer?
Is there any other way available for declarative transaction management too?
declarative transaction management in spring 3.1+
215 Views Asked by IUnknown At
1
There are 1 best solutions below
Related Questions in SPRING
- Redirect inside java interceptor
- Spring RestTemplate passing the type of the response
- spring-integration-dsl-groovy-http return null when i use httpGet method
- Custom Spring annotation for request parameters
- Spring - configure Jboss Intros for xml with java config?
- HTTP Status 404 - Not Found in Spring 3.2.7
- AndroidAnnotations how to use setBearerAuth
- android I/O error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
- Show login dialog when not authenticated yet
- Spring Data Rest supporting json and xml
- @Value annotation not resolved in a class that belongs to dependency jar
- Remove nested _embedded fields while using projections
- How to send Rest GET request that contains "#" value in url parameters?
- How to inject spring bean into Validator(hibernate)
- How to keep a variable in the URL when using Spring LocaleChangeInterceptor
Related Questions in SPRING-TRANSACTIONS
- Multiple transaction managers - Selecting a one at runtime - Spring
- Oracle Toplink 11g with Spring 2.5.6 Transaction Manager
- HibernateDAOSupport vs HibernateTemplate
- Upgrading spring transaction from 1.2.5 to 4.1.1
- Spring @Transactional(propagation=Propagation.REQUIRED) does not roll out outer transaction when inner transaction throws an exception
- Spring transaction retry
- Is spring transaction is only working in entering service method?
- Why is @Transactional(Propagation.NOT_SUPPORTED) not working as expected?
- How to remove non-transactional database logging after running integration tests?
- Does Spring rollback on Runtime Exception when rollback for checked exception is specified in @Transactional annotation
- Spring boot @Transactionnal imbrication bad practice?
- Spring 4.1 to 4.2 migrattion : Why the persistence does not work?
- JpaRepository save flushes all entities
- JOOQ: Is a single statement implicitly transactional, or do I still have to wrap it in a transactional block?
- Control step level execution in spring batch
Related Questions in TRANSACTIONMANAGER
- Oracle Toplink 11g with Spring 2.5.6 Transaction Manager
- UPDATE statement on table xxx' expected to update 1 row(s); 0 were matched with Zope transactionmanager
- Spring JDBC Template with business level transaction management
- createCriteria requires an active transaction
- Spring JpaTransactionManager not saving Activiti entities to DB
- springframework.beans.factory.NoUniqueBeanDefinitionException
- Spring Batch Composite Item Writer Transaction Management
- ormlite for android: design help and more
- Transaction not active exception - EJB Transaction State
- Is it a good practice to have transaction manager bean as Prototype scoped
- How to synchronize JOOQ with SpringBatch JdbcTemplate
- Spring boot data JPA getting NullPointerException related to transaction manager
- Commit/rollback transactions manually with multiple datasources in Micronaut
- Atomikos silently rollback transaction without any Exception
- declarative transaction management in spring 3.1+
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Advantages of annotaions way:
Advantages of xml way:
I prefer annotations where it is possible. It saves a lot of time when you read the code (you do not need open one more file and check it periodically).
Other way for declarative transactions: use
<aop:config>with<tx:advice>. See corresponding entry in official documentation. It is a variation of xml way that is more easy to do then ProxyFactoryBean (you do not need to wrap beans / declare transaction interceptor manually).Hope this helps.